diff --git a/.clang-format b/.clang-format index b53e68905d06c63603098993db42e465581ed50a..fbb4eda1ba03a8f4b7d2a56edaac6e698d897c9c 100644 --- a/.clang-format +++ b/.clang-format @@ -2,5 +2,4 @@ Language: Cpp BasedOnStyle: LLVM Standard: Cpp11 -IndentWidth: 4 ... diff --git a/.gitignore b/.gitignore index a21928fb0939b28798143d9173a007b7e2ce8ec7..a6225fe41666b36a806360694b51984bdaf788f3 100644 --- a/.gitignore +++ b/.gitignore @@ -54,5 +54,6 @@ paddle-mobile.cbp compile_commands.json cmake-build-debug/ +cmake-build-release/ -test/models/ \ No newline at end of file +test/models/ diff --git a/cmake-build-release/compile_commands.json b/cmake-build-release/compile_commands.json deleted file mode 100644 index 3e74ba82b3cc71fe5286a446b1a5eb26bd0a8daa..0000000000000000000000000000000000000000 --- a/cmake-build-release/compile_commands.json +++ /dev/null @@ -1,312 +0,0 @@ -[ -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/framework/ddim.cc.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/ddim.cc", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/ddim.cc" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/framework/lod_tensor.cc.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/lod_tensor.cc", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/lod_tensor.cc" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/framework/scope.cc.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/scope.cc", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/scope.cc" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/framework/tensor_util.cc.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/tensor_util.cc", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/tensor_util.cc" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/memory/t_malloc.cc.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/memory/t_malloc.cc", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/memory/t_malloc.cc" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/operators/math/im2col.cc.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/math/im2col.cc", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/math/im2col.cc" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/operators/math/math_function.cc.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/math/math_function.cc", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/math/math_function.cc" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/operators/math/vol2col.cc.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/math/vol2col.cc", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/math/vol2col.cc" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/common/variant.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/common/variant.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/common/variant.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/framework/attribute.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/attribute.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/attribute.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/framework/block_desc.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/block_desc.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/block_desc.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/framework/data_transform.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/data_transform.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/data_transform.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/framework/executor.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/executor.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/executor.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/framework/framework.pb.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/framework.pb.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/framework.pb.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/framework/op_desc.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/op_desc.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/op_desc.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/framework/operator.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/operator.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/operator.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/framework/paddle_mobile_object.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/paddle_mobile_object.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/paddle_mobile_object.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/framework/program.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/program.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/program.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/framework/program_desc.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/program_desc.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/program_desc.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/framework/var_desc.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/var_desc.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/var_desc.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/io.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/io.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/io.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/operators/conv_op.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/conv_op.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/conv_op.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/operators/elementwise_add_op.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/elementwise_add_op.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/elementwise_add_op.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/operators/kernel/arm/conv_kernel.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/kernel/arm/conv_kernel.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/kernel/arm/conv_kernel.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/operators/kernel/arm/elementwise_add_kernel.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/kernel/arm/elementwise_add_kernel.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/kernel/arm/elementwise_add_kernel.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/operators/kernel/arm/mul_kernel.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/kernel/arm/mul_kernel.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/kernel/arm/mul_kernel.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/operators/kernel/fpga/conv_kernel.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/kernel/fpga/conv_kernel.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/kernel/fpga/conv_kernel.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/operators/mul_op.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/mul_op.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/mul_op.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-static.dir/src/operators/op_param.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/op_param.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/op_param.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/framework/ddim.cc.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/ddim.cc", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/ddim.cc" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/framework/lod_tensor.cc.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/lod_tensor.cc", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/lod_tensor.cc" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/framework/scope.cc.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/scope.cc", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/scope.cc" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/framework/tensor_util.cc.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/tensor_util.cc", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/tensor_util.cc" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/memory/t_malloc.cc.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/memory/t_malloc.cc", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/memory/t_malloc.cc" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/operators/math/im2col.cc.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/math/im2col.cc", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/math/im2col.cc" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/operators/math/math_function.cc.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/math/math_function.cc", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/math/math_function.cc" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/operators/math/vol2col.cc.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/math/vol2col.cc", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/math/vol2col.cc" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/common/variant.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/common/variant.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/common/variant.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/framework/attribute.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/attribute.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/attribute.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/framework/block_desc.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/block_desc.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/block_desc.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/framework/data_transform.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/data_transform.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/data_transform.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/framework/executor.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/executor.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/executor.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/framework/framework.pb.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/framework.pb.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/framework.pb.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/framework/op_desc.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/op_desc.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/op_desc.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/framework/operator.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/operator.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/operator.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/framework/paddle_mobile_object.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/paddle_mobile_object.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/paddle_mobile_object.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/framework/program.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/program.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/program.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/framework/program_desc.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/program_desc.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/program_desc.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/framework/var_desc.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/framework/var_desc.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/framework/var_desc.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/io.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/io.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/io.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/operators/conv_op.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/conv_op.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/conv_op.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/operators/elementwise_add_op.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/elementwise_add_op.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/elementwise_add_op.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/operators/kernel/arm/conv_kernel.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/kernel/arm/conv_kernel.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/kernel/arm/conv_kernel.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/operators/kernel/arm/elementwise_add_kernel.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/kernel/arm/elementwise_add_kernel.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/kernel/arm/elementwise_add_kernel.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/operators/kernel/arm/mul_kernel.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/kernel/arm/mul_kernel.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/kernel/arm/mul_kernel.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/operators/kernel/fpga/conv_kernel.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/kernel/fpga/conv_kernel.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/kernel/fpga/conv_kernel.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/operators/mul_op.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/mul_op.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/mul_op.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -Dpaddle_mobile_EXPORTS -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/paddle-mobile.dir/src/operators/op_param.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/src/operators/op_param.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/src/operators/op_param.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release/test", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/test-log.dir/common/test_log.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/test/common/test_log.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/test/common/test_log.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release/test", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/test-conv-op.dir/operators/test_cov_op.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/test/operators/test_cov_op.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/test/operators/test_cov_op.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release/test", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/test-load.dir/framework/test_load.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/test/framework/test_load.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/test/framework/test_load.cpp" -}, -{ - "directory": "/Users/allonli/Documents/workspace/paddle-mobile/cmake-build-release/test", - "command": "/Library/Developer/CommandLineTools/usr/bin/c++ -DPADDLE_MOBILE_DEBUG=\\\"true\\\" -I/Users/allonli/Documents/workspace/paddle-mobile/src -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/openblas/include -I/Users/allonli/Documents/workspace/paddle-mobile/third-party/protobuf/include -O2 -g -DNDEBUG -std=c++11 -o CMakeFiles/paddle-mobile-test.dir/main.cpp.o -c /Users/allonli/Documents/workspace/paddle-mobile/test/main.cpp", - "file": "/Users/allonli/Documents/workspace/paddle-mobile/test/main.cpp" -} -] \ No newline at end of file diff --git a/src/common/log.h b/src/common/log.h index d8fa8136d68e2d676a4c3242e2192eb52cf11909..8b85169595a83ced5293a604cc80bb1de2fc71cf 100644 --- a/src/common/log.h +++ b/src/common/log.h @@ -28,15 +28,15 @@ SOFTWARE. namespace paddle_mobile { enum LogLevel { - kNO_LOG, - kLOG_ERROR, - kLOG_WARNING, - kLOG_INFO, - kLOG_DEBUG, - kLOG_DEBUG1, - kLOG_DEBUG2, - kLOG_DEBUG3, - kLOG_DEBUG4 + kNO_LOG, + kLOG_ERROR, + kLOG_WARNING, + kLOG_INFO, + kLOG_DEBUG, + kLOG_DEBUG1, + kLOG_DEBUG2, + kLOG_DEBUG3, + kLOG_DEBUG4 }; // log level @@ -49,119 +49,117 @@ struct ToLog; struct Print; struct Print { - friend struct ToLog; - - template Print &operator<<(T const &value) { - buffer_ << value; - return *this; - } - - private: - void print(LogLevel level) { - buffer_ << std::endl; - if (level == kLOG_ERROR) { - std::cerr << buffer_.str(); - } else { - std::cout << buffer_.str(); - } + friend struct ToLog; + + template Print &operator<<(T const &value) { + buffer_ << value; + return *this; + } + +private: + void print(LogLevel level) { + buffer_ << std::endl; + if (level == kLOG_ERROR) { + std::cerr << buffer_.str(); + } else { + std::cout << buffer_.str(); } - std::ostringstream buffer_; + } + std::ostringstream buffer_; }; struct ToLog { - ToLog(LogLevel level = kLOG_DEBUG, const std::string &info = "") - : level_(level) { - unsigned blanks = - (unsigned)(level > kLOG_DEBUG ? (level - kLOG_DEBUG) * 4 : 1); - printer_ << logs[level] << " " << info << ":" - << std::string(blanks, ' '); - } - - template ToLog &operator<<(T const &value) { - printer_ << value; - return *this; - } - - ~ToLog() { printer_.print(level_); } - - private: - LogLevel level_; - Print printer_; + ToLog(LogLevel level = kLOG_DEBUG, const std::string &info = "") + : level_(level) { + unsigned blanks = + (unsigned)(level > kLOG_DEBUG ? (level - kLOG_DEBUG) * 4 : 1); + printer_ << logs[level] << " " << info << ":" << std::string(blanks, ' '); + } + + template ToLog &operator<<(T const &value) { + printer_ << value; + return *this; + } + + ~ToLog() { printer_.print(level_); } + +private: + LogLevel level_; + Print printer_; }; #define LOG(level) \ - if (level > paddle_mobile::log_level) { \ - } else \ - paddle_mobile::ToLog( \ - level, (std::stringstream() \ - << "[file: " \ - << (strrchr(__FILE__, '/') ? (strrchr(__FILE__, '/') + 1) \ - : __FILE__) \ - << "] [line: " << __LINE__ << "] ") \ - .str()) + if (level > paddle_mobile::log_level) { \ + } else \ + paddle_mobile::ToLog( \ + level, \ + (std::stringstream() \ + << "[file: " \ + << (strrchr(__FILE__, '/') ? (strrchr(__FILE__, '/') + 1) : __FILE__) \ + << "] [line: " << __LINE__ << "] ") \ + .str()) #define DLOG \ - if (paddle_mobile::kLOG_DEBUG > paddle_mobile::log_level) { \ - } else \ - paddle_mobile::ToLog( \ - paddle_mobile::kLOG_DEBUG, \ - (std::stringstream() \ - << "[file: " \ - << (strrchr(__FILE__, '/') ? (strrchr(__FILE__, '/') + 1) \ - : __FILE__) \ - << "] [line: " << __LINE__ << "] ") \ - .str()) + if (paddle_mobile::kLOG_DEBUG > paddle_mobile::log_level) { \ + } else \ + paddle_mobile::ToLog( \ + paddle_mobile::kLOG_DEBUG, \ + (std::stringstream() \ + << "[file: " \ + << (strrchr(__FILE__, '/') ? (strrchr(__FILE__, '/') + 1) : __FILE__) \ + << "] [line: " << __LINE__ << "] ") \ + .str()) } // namespace paddle_mobile #define LOGF(level, format, ...) \ - if (level > paddle_mobile::log_level) { \ - } else \ - printf(format, ##__VA_ARGS__) + if (level > paddle_mobile::log_level) { \ + } else \ + printf(format, ##__VA_ARGS__) #define DLOGF(format, ...) \ - if (paddle_mobile::kLOG_DEBUG > paddle_mobile::log_level) { \ - } else \ - printf(format, ##__VA_ARGS__) + if (paddle_mobile::kLOG_DEBUG > paddle_mobile::log_level) { \ + } else \ + printf(format, ##__VA_ARGS__) #else namespace paddle_mobile { enum LogLevel { - kNO_LOG, - kLOG_ERROR, - kLOG_WARNING, - kLOG_INFO, - kLOG_DEBUG, - kLOG_DEBUG1, - kLOG_DEBUG2, - kLOG_DEBUG3, - kLOG_DEBUG4 + kNO_LOG, + kLOG_ERROR, + kLOG_WARNING, + kLOG_INFO, + kLOG_DEBUG, + kLOG_DEBUG1, + kLOG_DEBUG2, + kLOG_DEBUG3, + kLOG_DEBUG4 }; struct ToLog; struct Print { - friend struct ToLog; - template Print &operator<<(T const &value) {} + friend struct ToLog; + template Print &operator<<(T const &value) {} - private: +private: }; struct ToLog { - ToLog(LogLevel level) {} + ToLog(LogLevel level) {} - template ToLog &operator<<(T const &value) { return *this; } + template ToLog &operator<<(T const &value) { return *this; } }; #define LOG(level) \ - if (true) { \ - } else \ - paddle_mobile::ToLog(level) + if (true) { \ + } else \ + paddle_mobile::ToLog(level) #define DLOG \ - if (true) { \ - } else \ - paddle_mobile::ToLog(paddle_mobile::kLOG_DEBUG) + if (true) { \ + } else \ + paddle_mobile::ToLog(paddle_mobile::kLOG_DEBUG) #define LOGF(level, format, ...) diff --git a/src/common/types.h b/src/common/types.h index 5008b8af312b5cbeec77415d33c30b6c8fe9b4c2..84af63e4bcfd57fe2ac4f7e2525e31213ff2692a 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -32,32 +32,32 @@ typedef DeviceType GPU_MALI; //! data type enum DataType { - PM_INVALID = -1, - PM_HALF = 0, - PM_FLOAT = 1, - PM_DOUBLE = 2, - PM_INT8 = 3, - PM_INT16 = 4, - PM_INT32 = 5, - PM_INT64 = 6, - PM_UINT8 = 7, - PM_UINT16 = 8, - PM_UINT32 = 9, - PM_STRING = 10, - PM_BOOL = 11, - PM_SHAPE = 12, - PM_TENSOR = 13 + PM_INVALID = -1, + PM_HALF = 0, + PM_FLOAT = 1, + PM_DOUBLE = 2, + PM_INT8 = 3, + PM_INT16 = 4, + PM_INT32 = 5, + PM_INT64 = 6, + PM_UINT8 = 7, + PM_UINT16 = 8, + PM_UINT32 = 9, + PM_STRING = 10, + PM_BOOL = 11, + PM_SHAPE = 12, + PM_TENSOR = 13 }; //! enum PMStatus { - PMSuccess = 0xFF, /*!< No errors */ - PMNotInitialized = 0x01, /*!< Data not initialized. */ - PMInvalidValue = 0x02, /*!< Incorrect variable value. */ - PMMemAllocFailed = 0x03, /*!< Memory allocation error. */ - PMUnKownError = 0x04, /*!< Unknown error. */ - PMOutOfAuthority = 0x05, /*!< Try to modified data not your own*/ - PMOutOfMem = 0x06, /*!< OOM error*/ - PMUnImplError = 0x07, /*!< Unimplement error. */ - PMWrongDevice = 0x08 /*!< un-correct device. */ + PMSuccess = 0xFF, /*!< No errors */ + PMNotInitialized = 0x01, /*!< Data not initialized. */ + PMInvalidValue = 0x02, /*!< Incorrect variable value. */ + PMMemAllocFailed = 0x03, /*!< Memory allocation error. */ + PMUnKownError = 0x04, /*!< Unknown error. */ + PMOutOfAuthority = 0x05, /*!< Try to modified data not your own*/ + PMOutOfMem = 0x06, /*!< OOM error*/ + PMUnImplError = 0x07, /*!< Unimplement error. */ + PMWrongDevice = 0x08 /*!< un-correct device. */ }; } // namespace paddle_mobile diff --git a/src/common/variant.h b/src/common/variant.h index 012990dabd0085a9462d785882462ea834621c57..24eee64ff387b638a8650fb9be230aed75b8a8d7 100644 --- a/src/common/variant.h +++ b/src/common/variant.h @@ -24,74 +24,74 @@ namespace paddle_mobile { template struct IDToType { typedef Type type_t; }; template struct VariantHelper { - static const size_t size = sizeof(F) > VariantHelper::size - ? sizeof(F) - : VariantHelper::size; + static const size_t size = sizeof(F) > VariantHelper::size + ? sizeof(F) + : VariantHelper::size; - inline static void Destroy(size_t id, void *data) { - if (id == typeid(F).hash_code()) { - reinterpret_cast(data)->~F(); - } else { - VariantHelper::Destroy(id, data); - } + inline static void Destroy(size_t id, void *data) { + if (id == typeid(F).hash_code()) { + reinterpret_cast(data)->~F(); + } else { + VariantHelper::Destroy(id, data); } + } }; template struct VariantHelper { - static const size_t size = sizeof(F); - inline static void Destroy(size_t id, void *data) { - if (id == typeid(F).hash_code()) { - // reinterpret_cast(data)->~F(); - } else { - // std::cout << "未匹配到 " << std::endl; - } + static const size_t size = sizeof(F); + inline static void Destroy(size_t id, void *data) { + if (id == typeid(F).hash_code()) { + // reinterpret_cast(data)->~F(); + } else { + // std::cout << "未匹配到 " << std::endl; } + } }; template class RawData { - public: - char data[size]; - RawData() {} - RawData(const RawData &raw_data) { strcpy(data, raw_data.data); } - // void operator=(const RawData &raw_data){ - // strcpy(data, raw_data.data); - // } +public: + char data[size]; + RawData() {} + RawData(const RawData &raw_data) { strcpy(data, raw_data.data); } + // void operator=(const RawData &raw_data){ + // strcpy(data, raw_data.data); + // } }; template struct Variant { - Variant(const Variant &variant) { - // std::cout << " 赋值构造函数 " << std::endl; - type_id = variant.type_id; - data = variant.data; - } + Variant(const Variant &variant) { + // std::cout << " 赋值构造函数 " << std::endl; + type_id = variant.type_id; + data = variant.data; + } - Variant() : type_id(invalid_type()) {} - ~Variant() { - // helper::Destroy(type_id, &data); - } + Variant() : type_id(invalid_type()) {} + ~Variant() { + // helper::Destroy(type_id, &data); + } - template void Set(Args &&... args) { - helper::Destroy(type_id, &data); - new (&data) T(std::forward(args)...); - type_id = typeid(T).hash_code(); - } + template void Set(Args &&... args) { + helper::Destroy(type_id, &data); + new (&data) T(std::forward(args)...); + type_id = typeid(T).hash_code(); + } - template T &Get() const { - if (type_id == typeid(T).hash_code()) { - return *const_cast(reinterpret_cast(&data)); - } else { - // std::cout << " bad cast in variant " << std::endl; - throw std::bad_cast(); - } + template T &Get() const { + if (type_id == typeid(T).hash_code()) { + return *const_cast(reinterpret_cast(&data)); + } else { + // std::cout << " bad cast in variant " << std::endl; + throw std::bad_cast(); } + } - size_t TypeId() const { return type_id; } + size_t TypeId() const { return type_id; } - private: - static inline size_t invalid_type() { return typeid(void).hash_code(); } - typedef VariantHelper helper; - size_t type_id; - RawData data; +private: + static inline size_t invalid_type() { return typeid(void).hash_code(); } + typedef VariantHelper helper; + size_t type_id; + RawData data; }; template struct Vistor { typedef T type_t; }; diff --git a/src/framework/attribute.h b/src/framework/attribute.h index c2e72709538af7b598c4d7790158a95df236283c..8f0f11c70e3cd8da65b6ae04de0b3ce12c2c9400 100644 --- a/src/framework/attribute.h +++ b/src/framework/attribute.h @@ -27,102 +27,102 @@ namespace framework { class BlockDesc; class Attribute { - public: - static Attribute GetAttrValue(const proto::OpDesc::Attr &attr_desc) { - // std::cout << "begin get attr value" << std::endl; - Attribute attr; - switch (attr_desc.type()) { - case proto::AttrType::BOOLEAN: { - attr.Set(attr_desc.b()); - break; - } - case proto::AttrType::INT: { - attr.Set(attr_desc.i()); - break; - } - case proto::AttrType::FLOAT: { - attr.Set(attr_desc.f()); - break; - } - case proto::AttrType::STRING: { - attr.Set(attr_desc.s()); - break; - } - case proto::AttrType::BOOLEANS: { - std::vector val(attr_desc.bools_size()); - for (int i = 0; i < attr_desc.bools_size(); ++i) { - val[i] = attr_desc.bools(i); - } - attr.Set>(val); - break; - } - case proto::AttrType::INTS: { - std::vector val(attr_desc.ints_size()); - for (int i = 0; i < attr_desc.ints_size(); ++i) { - val[i] = attr_desc.ints(i); - } - attr.Set>(val); - break; - } - case proto::AttrType::FLOATS: { - std::vector val(attr_desc.floats_size()); - for (int i = 0; i < attr_desc.floats_size(); ++i) { - val[i] = attr_desc.floats(i); - } - attr.Set>(val); - break; - } - case proto::AttrType::STRINGS: { - std::vector val(attr_desc.strings_size()); - for (int i = 0; i < attr_desc.strings_size(); ++i) { - val[i] = attr_desc.strings(i); - } - attr.Set>(val); - break; - } - case proto::AttrType::LONG: { - attr.Set(attr_desc.l()); - break; - } - default: - // std::cout << " not support " << std::endl; - break; - } - // std::cout << "end get attr value" << std::endl; - return attr; +public: + static Attribute GetAttrValue(const proto::OpDesc::Attr &attr_desc) { + // std::cout << "begin get attr value" << std::endl; + Attribute attr; + switch (attr_desc.type()) { + case proto::AttrType::BOOLEAN: { + attr.Set(attr_desc.b()); + break; } - - Attribute() {} - template Attribute &Set(Args &&... args) { - variant_.Set(args...); - return *this; + case proto::AttrType::INT: { + attr.Set(attr_desc.i()); + break; + } + case proto::AttrType::FLOAT: { + attr.Set(attr_desc.f()); + break; + } + case proto::AttrType::STRING: { + attr.Set(attr_desc.s()); + break; + } + case proto::AttrType::BOOLEANS: { + std::vector val(attr_desc.bools_size()); + for (int i = 0; i < attr_desc.bools_size(); ++i) { + val[i] = attr_desc.bools(i); + } + attr.Set>(val); + break; + } + case proto::AttrType::INTS: { + std::vector val(attr_desc.ints_size()); + for (int i = 0; i < attr_desc.ints_size(); ++i) { + val[i] = attr_desc.ints(i); + } + attr.Set>(val); + break; + } + case proto::AttrType::FLOATS: { + std::vector val(attr_desc.floats_size()); + for (int i = 0; i < attr_desc.floats_size(); ++i) { + val[i] = attr_desc.floats(i); + } + attr.Set>(val); + break; } + case proto::AttrType::STRINGS: { + std::vector val(attr_desc.strings_size()); + for (int i = 0; i < attr_desc.strings_size(); ++i) { + val[i] = attr_desc.strings(i); + } + attr.Set>(val); + break; + } + case proto::AttrType::LONG: { + attr.Set(attr_desc.l()); + break; + } + default: + // std::cout << " not support " << std::endl; + break; + } + // std::cout << "end get attr value" << std::endl; + return attr; + } - template T &Get() const { return variant_.Get(); } + Attribute() {} + template Attribute &Set(Args &&... args) { + variant_.Set(args...); + return *this; + } - private: - Variant, std::vector, - std::vector, bool, std::vector, BlockDesc *, - int64_t> - variant_; + template T &Get() const { return variant_.Get(); } + +private: + Variant, std::vector, + std::vector, bool, std::vector, BlockDesc *, + int64_t> + variant_; }; using AttributeMap = std::unordered_map; class AttrReader { - public: - explicit AttrReader(const AttributeMap &attrs) : attrs_(attrs) {} +public: + explicit AttrReader(const AttributeMap &attrs) : attrs_(attrs) {} - template inline T Get(const std::string &name) const { - // PADDLE_ENFORCE(attrs_.count(name) != 0, "%s should - // be in - // AttributeMap", - // name); - return ((Attribute)attrs_.at(name)).Get(); - } + template inline T Get(const std::string &name) const { + // PADDLE_ENFORCE(attrs_.count(name) != 0, "%s should + // be in + // AttributeMap", + // name); + return ((Attribute)attrs_.at(name)).Get(); + } - private: - const AttributeMap &attrs_; +private: + const AttributeMap &attrs_; }; } // namespace framework diff --git a/src/framework/block_desc.cpp b/src/framework/block_desc.cpp index fc96ef104c1d96a319686090c1b39c33b7f48797..ed7e25478fe43e62302d897c302ecde4ff30bdea 100644 --- a/src/framework/block_desc.cpp +++ b/src/framework/block_desc.cpp @@ -22,28 +22,28 @@ namespace paddle_mobile { namespace framework { std::vector> BlockDesc::Vars() const { - std::vector> res; - for (const auto &p : vars_) { - res.push_back(p.second); - } - return res; + std::vector> res; + for (const auto &p : vars_) { + res.push_back(p.second); + } + return res; } std::vector> BlockDesc::Ops() const { - std::vector> res; - for (const auto &op : ops_) { - res.push_back(op); - } - return res; + std::vector> res; + for (const auto &op : ops_) { + res.push_back(op); + } + return res; } BlockDesc::BlockDesc(const proto::BlockDesc &desc) : desc_(desc) { - for (const proto::VarDesc &var_desc : desc_.vars()) { - vars_[var_desc.name()].reset(new VarDesc(var_desc)); - } - for (const proto::OpDesc &op_desc : desc_.ops()) { - ops_.emplace_back(new framework::OpDesc(op_desc)); - } + for (const proto::VarDesc &var_desc : desc_.vars()) { + vars_[var_desc.name()].reset(new VarDesc(var_desc)); + } + for (const proto::OpDesc &op_desc : desc_.ops()) { + ops_.emplace_back(new framework::OpDesc(op_desc)); + } } } // namespace framework diff --git a/src/framework/block_desc.h b/src/framework/block_desc.h index 49f31c889a47d36fb28c93c8a7aca4cbf6c965cc..4a71c1b7a0e6826b63370558b2dd1a758d800dcd 100644 --- a/src/framework/block_desc.h +++ b/src/framework/block_desc.h @@ -27,29 +27,28 @@ namespace paddle_mobile { namespace framework { class BlockDesc : PaddleMobileObject { - public: - BlockDesc(const proto::BlockDesc &desc); +public: + BlockDesc(const proto::BlockDesc &desc); - const int &ID() const { return desc_.idx(); } + const int &ID() const { return desc_.idx(); } - const int &Parent() const { return desc_.parent_idx(); } + const int &Parent() const { return desc_.parent_idx(); } - bool operator==(const paddle_mobile::framework::BlockDesc &in_block) const { - return this->ID() == in_block.ID() && - this->Parent() == in_block.Parent(); - } + bool operator==(const paddle_mobile::framework::BlockDesc &in_block) const { + return this->ID() == in_block.ID() && this->Parent() == in_block.Parent(); + } - bool operator<(const paddle_mobile::framework::BlockDesc &in_block) const { - return this->ID() < in_block.ID() && this->Parent() < in_block.Parent(); - } + bool operator<(const paddle_mobile::framework::BlockDesc &in_block) const { + return this->ID() < in_block.ID() && this->Parent() < in_block.Parent(); + } - std::vector> Vars() const; - std::vector> Ops() const; + std::vector> Vars() const; + std::vector> Ops() const; - private: - proto::BlockDesc desc_; - std::vector> ops_; - std::unordered_map> vars_; +private: + proto::BlockDesc desc_; + std::vector> ops_; + std::unordered_map> vars_; }; } // namespace framework @@ -58,13 +57,13 @@ class BlockDesc : PaddleMobileObject { namespace std { template <> struct hash { - typedef paddle_mobile::framework::BlockDesc argument_type; - typedef std::size_t result_type; - result_type operator()(argument_type const &s) const noexcept { - result_type const h1(std::hash{}(s.ID())); - result_type const h2(std::hash{}(s.ID())); - return h1 ^ (h2 << 1); - } + typedef paddle_mobile::framework::BlockDesc argument_type; + typedef std::size_t result_type; + result_type operator()(argument_type const &s) const noexcept { + result_type const h1(std::hash{}(s.ID())); + result_type const h2(std::hash{}(s.ID())); + return h1 ^ (h2 << 1); + } }; } // namespace std diff --git a/src/framework/data_layout.h b/src/framework/data_layout.h index a30aa584442475d3561f059860503810562fd765..bb76f224a8d932c04982bef322ef82368f4c82df 100644 --- a/src/framework/data_layout.h +++ b/src/framework/data_layout.h @@ -22,45 +22,45 @@ namespace paddle_mobile { namespace framework { enum class DataLayout { - kNHWC = 0, - kNCHW = 1, - kAnyLayout = 2, + kNHWC = 0, + kNCHW = 1, + kAnyLayout = 2, }; inline DataLayout StringToDataLayout(const std::string &str) { - std::string s(str); - for (size_t i = 0; i < s.size(); ++i) { - s[i] = toupper(s[i]); - } + std::string s(str); + for (size_t i = 0; i < s.size(); ++i) { + s[i] = toupper(s[i]); + } - if (s == "NHWC") { - return DataLayout::kNHWC; - } else if (s == "NCHW") { - return DataLayout::kNCHW; - } else if (s == "ANYLAYOUT") { - return DataLayout::kAnyLayout; - } else { - // std::cout << "Unknown storage order string: %s", s; - } + if (s == "NHWC") { + return DataLayout::kNHWC; + } else if (s == "NCHW") { + return DataLayout::kNCHW; + } else if (s == "ANYLAYOUT") { + return DataLayout::kAnyLayout; + } else { + // std::cout << "Unknown storage order string: %s", s; + } } inline std::string DataLayoutToString(const DataLayout &data_layout) { - switch (data_layout) { - case DataLayout::kNHWC: - return "NHWC"; - case DataLayout::kNCHW: - return "NCHW"; - case DataLayout::kAnyLayout: - return "ANY_LAYOUT"; - default: - break; - // std::cout << "unknown DataLayou %d", data_layout; - } + switch (data_layout) { + case DataLayout::kNHWC: + return "NHWC"; + case DataLayout::kNCHW: + return "NCHW"; + case DataLayout::kAnyLayout: + return "ANY_LAYOUT"; + default: + break; + // std::cout << "unknown DataLayou %d", data_layout; + } } inline std::ostream &operator<<(std::ostream &out, const DataLayout &l) { - out << DataLayoutToString(l); - return out; + out << DataLayoutToString(l); + return out; } } // namespace framework diff --git a/src/framework/data_transform.cpp b/src/framework/data_transform.cpp index d85116e9e42725d6700d926ee6c938bb4f2139e6..996249fc4a840aa57c127e078421a6db84e1fe18 100644 --- a/src/framework/data_transform.cpp +++ b/src/framework/data_transform.cpp @@ -24,68 +24,68 @@ namespace paddle_mobile { namespace framework { static void PassTensorData(Tensor *from, Tensor *to) { - to->ShareDataWith(*from); - *from = Tensor(); + to->ShareDataWith(*from); + *from = Tensor(); } void DataTransform(const OpKernelType &expected_kernel_type, const OpKernelType &kernel_type_for_var, const Tensor &input_tensor, Tensor *output_tensor) { - bool transformed = false; - Tensor in; - in.ShareDataWith(input_tensor); - Tensor out; + bool transformed = false; + Tensor in; + in.ShareDataWith(input_tensor); + Tensor out; - // // do layout transform - // if (NeedTransformLayout(expected_kernel_type.data_layout_, - // kernel_type_for_var.data_layout_)) { - // TransDataLayout(kernel_type_for_var, expected_kernel_type, in, - // &out); - // transformed = true; - // PassTensorData(&out, &in); - // } - // - // // do data type transform - // if (expected_kernel_type.data_type_ != - // kernel_type_for_var.data_type_) { - // TransDataType(kernel_type_for_var, expected_kernel_type, in, - // &out); - // transformed = true; - // PassTensorData(&out, &in); - // } - // - // // do device transform - // if (!platform::is_same_place(kernel_type_for_var.place_, - // expected_kernel_type.place_)) { - // TransDataDevice(in, expected_kernel_type.place_, &out); - // transformed = true; - // PassTensorData(&out, &in); - // } - // - // PADDLE_ENFORCE(transformed, "No transform is applied, please - // check!"); - // get output data - output_tensor->ShareDataWith(in); + // // do layout transform + // if (NeedTransformLayout(expected_kernel_type.data_layout_, + // kernel_type_for_var.data_layout_)) { + // TransDataLayout(kernel_type_for_var, expected_kernel_type, in, + // &out); + // transformed = true; + // PassTensorData(&out, &in); + // } + // + // // do data type transform + // if (expected_kernel_type.data_type_ != + // kernel_type_for_var.data_type_) { + // TransDataType(kernel_type_for_var, expected_kernel_type, in, + // &out); + // transformed = true; + // PassTensorData(&out, &in); + // } + // + // // do device transform + // if (!platform::is_same_place(kernel_type_for_var.place_, + // expected_kernel_type.place_)) { + // TransDataDevice(in, expected_kernel_type.place_, &out); + // transformed = true; + // PassTensorData(&out, &in); + // } + // + // PADDLE_ENFORCE(transformed, "No transform is applied, please + // check!"); + // get output data + output_tensor->ShareDataWith(in); } void CopyVariableWithTensor(const Variable &in_var, const Tensor &tensor, Variable &out_var) { - // if (in_var.IsType()) { - // auto& in_lod_tensor = in_var.Get(); - // auto* tran_lod_tensor = out_var.GetMutable(); - // tran_lod_tensor->set_lod(in_lod_tensor.lod()); - // tran_lod_tensor->set_layout(in_lod_tensor.layout()); - // tran_lod_tensor->ShareDataWith(tensor); - // } else if (in_var.IsType()) { - // auto& in_selected_rows = in_var.Get(); - // auto* trans_selected_rows = - // out_var.GetMutable(); - // trans_selected_rows->set_height(in_selected_rows.height()); - // trans_selected_rows->set_rows(in_selected_rows.rows()); - // trans_selected_rows->mutable_value()->ShareDataWith(tensor); - // } else { - // PADDLE_THROW("unknown var type"); - // } + // if (in_var.IsType()) { + // auto& in_lod_tensor = in_var.Get(); + // auto* tran_lod_tensor = out_var.GetMutable(); + // tran_lod_tensor->set_lod(in_lod_tensor.lod()); + // tran_lod_tensor->set_layout(in_lod_tensor.layout()); + // tran_lod_tensor->ShareDataWith(tensor); + // } else if (in_var.IsType()) { + // auto& in_selected_rows = in_var.Get(); + // auto* trans_selected_rows = + // out_var.GetMutable(); + // trans_selected_rows->set_height(in_selected_rows.height()); + // trans_selected_rows->set_rows(in_selected_rows.rows()); + // trans_selected_rows->mutable_value()->ShareDataWith(tensor); + // } else { + // PADDLE_THROW("unknown var type"); + // } } } // namespace framework diff --git a/src/framework/ddim.cc b/src/framework/ddim.cc index 3a26cc04207efe9b14a4015d59247bbcb0f4849f..6bb2d9e498badeeec6fe505785cc8c27179f970e 100644 --- a/src/framework/ddim.cc +++ b/src/framework/ddim.cc @@ -20,158 +20,156 @@ namespace framework { /// @cond HIDDEN template Dim make_dim(const int64_t *d) { - return Dim(*d, make_dim(d + 1)); + return Dim(*d, make_dim(d + 1)); } template <> Dim<0> make_dim<0>(const int64_t *d) { return Dim<0>(*d); } void make_ddim(DDim &ddim, const int64_t *dims, int n) { - switch (n) { - case 0: - ddim = make_dim<0>(dims); - break; - case 1: - ddim = make_dim<1>(dims); - break; - case 2: - ddim = make_dim<2>(dims); - break; - case 3: - ddim = make_dim<3>(dims); - break; - case 4: - ddim = make_dim<4>(dims); - break; - case 5: - ddim = make_dim<5>(dims); - break; - case 6: - ddim = make_dim<6>(dims); - break; - case 7: - ddim = make_dim<7>(dims); - break; - case 8: - ddim = make_dim<8>(dims); - break; - case 9: - ddim = make_dim<9>(dims); - break; - default: - // std::cout << "Dynamic dimensions must have between [1, - // 9] - // dimensions."; - break; - } + switch (n) { + case 0: + ddim = make_dim<0>(dims); + break; + case 1: + ddim = make_dim<1>(dims); + break; + case 2: + ddim = make_dim<2>(dims); + break; + case 3: + ddim = make_dim<3>(dims); + break; + case 4: + ddim = make_dim<4>(dims); + break; + case 5: + ddim = make_dim<5>(dims); + break; + case 6: + ddim = make_dim<6>(dims); + break; + case 7: + ddim = make_dim<7>(dims); + break; + case 8: + ddim = make_dim<8>(dims); + break; + case 9: + ddim = make_dim<9>(dims); + break; + default: + // std::cout << "Dynamic dimensions must have between [1, + // 9] + // dimensions."; + break; + } } /// @endcond DDim make_ddim(std::initializer_list dims) { - DDim result(make_dim(0)); - make_ddim(result, dims.begin(), dims.size()); - return result; + DDim result(make_dim(0)); + make_ddim(result, dims.begin(), dims.size()); + return result; } DDim make_ddim(const std::vector &dims) { - DDim result(make_dim(0)); - make_ddim(result, &dims[0], dims.size()); - return result; + DDim result(make_dim(0)); + make_ddim(result, &dims[0], dims.size()); + return result; } DDim make_ddim(const std::vector &dims) { - std::vector res(dims.size()); - std::transform(dims.begin(), dims.end(), res.begin(), - [](int d) { return static_cast(d); }); - return make_ddim(res); + std::vector res(dims.size()); + std::transform(dims.begin(), dims.end(), res.begin(), + [](int d) { return static_cast(d); }); + return make_ddim(res); } /// @cond HIDDEN // XXX For some reason, putting this in an anonymous namespace causes // errors struct DynamicMutableIndexer : Vistor { - public: - explicit DynamicMutableIndexer(int idx) : idx_(idx) {} +public: + explicit DynamicMutableIndexer(int idx) : idx_(idx) {} - template int64_t &operator()(Dim &dim) const { - return dim[idx_]; - } + template int64_t &operator()(Dim &dim) const { return dim[idx_]; } - private: - int idx_; +private: + int idx_; }; struct DynamicConstIndexer : public Vistor { - public: - explicit DynamicConstIndexer(int idx) : idx_(idx) {} +public: + explicit DynamicConstIndexer(int idx) : idx_(idx) {} - template int64_t operator()(const Dim &dim) const { - return dim[idx_]; - } + template int64_t operator()(const Dim &dim) const { + return dim[idx_]; + } - private: - int idx_; +private: + int idx_; }; /// @endcond int64_t &DDim::operator[](int idx) { - return DDim::ApplyVistor(DynamicMutableIndexer(idx), *this); + return DDim::ApplyVistor(DynamicMutableIndexer(idx), *this); } int64_t DDim::operator[](int idx) const { - return DDim::ApplyVistor(DynamicConstIndexer(idx), *this); + return DDim::ApplyVistor(DynamicConstIndexer(idx), *this); } int DDim::size() const { return arity(*this); } bool DDim::operator==(DDim d) const { - // if (var.which() != d.getVar().which()) { - // return false; - // } else { - std::vector v1 = vectorize(*this); - std::vector v2 = vectorize(d); - - for (unsigned int i = 0; i < v1.size(); i++) { - if (v1[i] != v2[i]) { - return false; - } + // if (var.which() != d.getVar().which()) { + // return false; + // } else { + std::vector v1 = vectorize(*this); + std::vector v2 = vectorize(d); + + for (unsigned int i = 0; i < v1.size(); i++) { + if (v1[i] != v2[i]) { + return false; } + } - return true; - // } + return true; + // } } bool DDim::operator!=(DDim d) const { return !(*this == d); } DDim DDim::operator+(DDim d) const { - std::vector v1 = vectorize(*this); - std::vector v2 = vectorize(d); + std::vector v1 = vectorize(*this); + std::vector v2 = vectorize(d); - std::vector v3; + std::vector v3; - assert(v1.size() == v2.size()); + assert(v1.size() == v2.size()); - for (unsigned int i = 0; i < v1.size(); i++) { - v3.push_back(v1[i] + v2[i]); - } + for (unsigned int i = 0; i < v1.size(); i++) { + v3.push_back(v1[i] + v2[i]); + } - return make_ddim(v3); + return make_ddim(v3); } DDim DDim::operator*(DDim d) const { - std::vector v1 = vectorize(*this); - std::vector v2 = vectorize(d); + std::vector v1 = vectorize(*this); + std::vector v2 = vectorize(d); - std::vector v3; + std::vector v3; - assert(v1.size() == v2.size()); + assert(v1.size() == v2.size()); - for (unsigned int i = 0; i < v1.size(); i++) { - v3.push_back(v1[i] * v2[i]); - } + for (unsigned int i = 0; i < v1.size(); i++) { + v3.push_back(v1[i] * v2[i]); + } - return make_ddim(v3); + return make_ddim(v3); } int64_t get(const DDim &ddim, int idx) { return ddim[idx]; } @@ -180,152 +178,152 @@ void set(DDim &ddim, int idx, int value) { ddim[idx] = value; } /// @cond HIDDEN struct VectorizeVisitor : Vistor { - std::vector &vector; + std::vector &vector; - explicit VectorizeVisitor(std::vector &v) : vector(v) {} + explicit VectorizeVisitor(std::vector &v) : vector(v) {} - template void operator()(const T &t) { - vector.push_back(t.head); - this->operator()(t.tail); - } + template void operator()(const T &t) { + vector.push_back(t.head); + this->operator()(t.tail); + } - void operator()(const Dim<0> &t) {} + void operator()(const Dim<0> &t) {} }; /// @endcond std::vector vectorize(const DDim &ddim) { - std::vector result; - VectorizeVisitor visitor(result); - DDim::ApplyVistor(visitor, ddim); - return result; + std::vector result; + VectorizeVisitor visitor(result); + DDim::ApplyVistor(visitor, ddim); + return result; } // NOTE: framework::vectorize converts to type int64_t // which does not fit cudnn inputs. std::vector vectorize2int(const DDim &ddim) { - std::vector temp = vectorize(ddim); - std::vector result(temp.begin(), temp.end()); - return result; + std::vector temp = vectorize(ddim); + std::vector result(temp.begin(), temp.end()); + return result; } struct ProductVisitor : Vistor { - template int64_t operator()(const Dim &dim) { - return product(dim); - } + template int64_t operator()(const Dim &dim) { + return product(dim); + } }; int64_t product(const DDim &ddim) { - ProductVisitor visitor; - return DDim::ApplyVistor(visitor, ddim); + ProductVisitor visitor; + return DDim::ApplyVistor(visitor, ddim); } struct SliceVectorizeVisitor : Vistor { - std::vector &vector; - int begin; - int end; - - SliceVectorizeVisitor(std::vector &v, int b, int e) - : vector(v), begin(b), end(e) { - // PADDLE_ENFORCE(begin < end, - // "Begin index must be less than end index in - // ddim - // slice."); - // PADDLE_ENFORCE(begin >= 0, - // "Begin index can't be less than zero in - // ddim slice."); + std::vector &vector; + int begin; + int end; + + SliceVectorizeVisitor(std::vector &v, int b, int e) + : vector(v), begin(b), end(e) { + // PADDLE_ENFORCE(begin < end, + // "Begin index must be less than end index in + // ddim + // slice."); + // PADDLE_ENFORCE(begin >= 0, + // "Begin index can't be less than zero in + // ddim slice."); + } + + template void operator()(const Dim &dim) { + if (begin == 0) { + vector.push_back(dim.head); + } else { + --begin; } - - template void operator()(const Dim &dim) { - if (begin == 0) { - vector.push_back(dim.head); - } else { - --begin; - } - --end; - if (end > 0) { - this->operator()(dim.tail); - } + --end; + if (end > 0) { + this->operator()(dim.tail); } + } - void operator()(const Dim<0> &dim) { - // PADDLE_ENFORCE(end == 0, "End index in ddim slice is out - // of bound."); - } + void operator()(const Dim<0> &dim) { + // PADDLE_ENFORCE(end == 0, "End index in ddim slice is out + // of bound."); + } }; DDim slice_ddim(const DDim &ddim, int begin, int end) { - std::vector vec; - vec.reserve(end - begin); - SliceVectorizeVisitor visitor(vec, begin, end); - // boost::apply_visitor(visitor, dim); - DDim::ApplyVistor(visitor, ddim); - // visitor(ddim.var.Get>()); - return make_ddim(vec); + std::vector vec; + vec.reserve(end - begin); + SliceVectorizeVisitor visitor(vec, begin, end); + // boost::apply_visitor(visitor, dim); + DDim::ApplyVistor(visitor, ddim); + // visitor(ddim.var.Get>()); + return make_ddim(vec); } /// \cond HIDDEN struct ArityVisitor : Vistor { - template int operator()(Dim) const { return D; } + template int operator()(Dim) const { return D; } }; /// \endcond int arity(const DDim &d) { - ArityVisitor arityVisitor = ArityVisitor(); - return DDim::ApplyVistor(arityVisitor, d); - // return arityVisitor(d.var.Get>()); - // return boost::apply_visitor(ArityVisitor(), d); } + ArityVisitor arityVisitor = ArityVisitor(); + return DDim::ApplyVistor(arityVisitor, d); + // return arityVisitor(d.var.Get>()); + // return boost::apply_visitor(ArityVisitor(), d); } } /// \cond HIDDEN /// \endcond struct OSVistor : Vistor { - OSVistor(std::ostream &os) : os_(os) {} + OSVistor(std::ostream &os) : os_(os) {} - template std::ostream &operator()(Dim dim) const { - return os_ << dim; - } + template std::ostream &operator()(Dim dim) const { + return os_ << dim; + } - private: - std::ostream &os_; +private: + std::ostream &os_; }; std::ostream &operator<<(std::ostream &os, const DDim &ddim) { - auto vistor = OSVistor(os); - DDim::ApplyVistor(vistor, ddim); - return os; + auto vistor = OSVistor(os); + DDim::ApplyVistor(vistor, ddim); + return os; } DDim::DDim(std::initializer_list init_list) { - *this = make_ddim(init_list); + *this = make_ddim(init_list); } DDim flatten_to_2d(const DDim &src, int num_col_dims) { - int rank = src.size(); - return make_ddim({product(slice_ddim(src, 0, num_col_dims)), - product(slice_ddim(src, num_col_dims, rank))}); + int rank = src.size(); + return make_ddim({product(slice_ddim(src, 0, num_col_dims)), + product(slice_ddim(src, num_col_dims, rank))}); } DDim flatten_to_1d(const DDim &src) { return make_ddim({product(src)}); } DDim stride(const DDim &ddim) { - std::vector strides(ddim.size()); - strides[ddim.size() - 1] = 1; - for (int i = ddim.size() - 2; i >= 0; --i) { - strides[i] = strides[i + 1] * ddim[i + 1]; - } - return framework::make_ddim(strides); + std::vector strides(ddim.size()); + strides[ddim.size() - 1] = 1; + for (int i = ddim.size() - 2; i >= 0; --i) { + strides[i] = strides[i + 1] * ddim[i + 1]; + } + return framework::make_ddim(strides); } DDim stride_numel(const framework::DDim &ddim) { - std::vector strides(ddim.size()); - strides[ddim.size() - 1] = ddim[ddim.size() - 1]; - for (int i = ddim.size() - 2; i >= 0; --i) { - strides[i] = strides[i + 1] * ddim[i]; - } - return framework::make_ddim(strides); + std::vector strides(ddim.size()); + strides[ddim.size() - 1] = ddim[ddim.size() - 1]; + for (int i = ddim.size() - 2; i >= 0; --i) { + strides[i] = strides[i + 1] * ddim[i]; + } + return framework::make_ddim(strides); } } // namespace framework diff --git a/src/framework/ddim.h b/src/framework/ddim.h index ccbdd6f861d2aea02834804add0619a7e459b2ba..8405aa3b47831047989cee9b1ff1adde83b143f2 100644 --- a/src/framework/ddim.h +++ b/src/framework/ddim.h @@ -30,77 +30,77 @@ namespace framework { * The number of dimensions must be between [1, 9]. */ struct DDim { - typedef Variant, Dim<1>, Dim<2>, Dim<3>, Dim<4>, Dim<5>, Dim<6>, - Dim<7>, Dim<8>, Dim<9>> - DDimVar; - DDimVar var; - - template - static typename Vistor::type_t ApplyVistor(Vistor vistor, const DDim &d) { - if (d.var.TypeId() == typeid(Dim<0>).hash_code()) { - return vistor(d.var.Get>()); - } else if (d.var.TypeId() == typeid(Dim<1>).hash_code()) { - return vistor(d.var.Get>()); - } else if (d.var.TypeId() == typeid(Dim<2>).hash_code()) { - return vistor(d.var.Get>()); - } else if (d.var.TypeId() == typeid(Dim<3>).hash_code()) { - return vistor(d.var.Get>()); - } else if (d.var.TypeId() == typeid(Dim<4>).hash_code()) { - return vistor(d.var.Get>()); - } else if (d.var.TypeId() == typeid(Dim<5>).hash_code()) { - return vistor(d.var.Get>()); - } else if (d.var.TypeId() == typeid(Dim<6>).hash_code()) { - return vistor(d.var.Get>()); - } else if (d.var.TypeId() == typeid(Dim<7>).hash_code()) { - return vistor(d.var.Get>()); - } else if (d.var.TypeId() == typeid(Dim<8>).hash_code()) { - return vistor(d.var.Get>()); - } else if (d.var.TypeId() == typeid(Dim<9>).hash_code()) { - return vistor(d.var.Get>()); - } else { - printf(" dim not support \n"); - throw std::bad_exception(); - // return typename Vistor::type_t(); - } + typedef Variant, Dim<1>, Dim<2>, Dim<3>, Dim<4>, Dim<5>, Dim<6>, + Dim<7>, Dim<8>, Dim<9>> + DDimVar; + DDimVar var; + + template + static typename Vistor::type_t ApplyVistor(Vistor vistor, const DDim &d) { + if (d.var.TypeId() == typeid(Dim<0>).hash_code()) { + return vistor(d.var.Get>()); + } else if (d.var.TypeId() == typeid(Dim<1>).hash_code()) { + return vistor(d.var.Get>()); + } else if (d.var.TypeId() == typeid(Dim<2>).hash_code()) { + return vistor(d.var.Get>()); + } else if (d.var.TypeId() == typeid(Dim<3>).hash_code()) { + return vistor(d.var.Get>()); + } else if (d.var.TypeId() == typeid(Dim<4>).hash_code()) { + return vistor(d.var.Get>()); + } else if (d.var.TypeId() == typeid(Dim<5>).hash_code()) { + return vistor(d.var.Get>()); + } else if (d.var.TypeId() == typeid(Dim<6>).hash_code()) { + return vistor(d.var.Get>()); + } else if (d.var.TypeId() == typeid(Dim<7>).hash_code()) { + return vistor(d.var.Get>()); + } else if (d.var.TypeId() == typeid(Dim<8>).hash_code()) { + return vistor(d.var.Get>()); + } else if (d.var.TypeId() == typeid(Dim<9>).hash_code()) { + return vistor(d.var.Get>()); + } else { + printf(" dim not support \n"); + throw std::bad_exception(); + // return typename Vistor::type_t(); } + } - DDim() { var.Set>(Dim<1>()); } + DDim() { var.Set>(Dim<1>()); } - template explicit DDim(const Dim &in) { var.Set>(in); } + template explicit DDim(const Dim &in) { var.Set>(in); } - /*implicit*/ DDim(std::initializer_list init_list); + /*implicit*/ DDim(std::initializer_list init_list); - template DDim &operator=(const Dim &in) { - var.Set>(in); - return *this; - } + template DDim &operator=(const Dim &in) { + var.Set>(in); + return *this; + } - int64_t &operator[](int idx); + int64_t &operator[](int idx); - int64_t operator[](int idx) const; + int64_t operator[](int idx) const; - // template - // typename Visitor::result_type apply_visitor(Visitor& visitor) { - // return var.apply_visitor(visitor); - // } - // - // template - // typename Visitor::result_type apply_visitor(Visitor& visitor) - // const { - // return var.apply_visitor(visitor); - // } + // template + // typename Visitor::result_type apply_visitor(Visitor& visitor) { + // return var.apply_visitor(visitor); + // } + // + // template + // typename Visitor::result_type apply_visitor(Visitor& visitor) + // const { + // return var.apply_visitor(visitor); + // } - DDimVar getVar() { return var; } + DDimVar getVar() { return var; } - bool operator==(DDim d) const; + bool operator==(DDim d) const; - bool operator!=(DDim d) const; + bool operator!=(DDim d) const; - DDim operator+(DDim d) const; + DDim operator+(DDim d) const; - DDim operator*(DDim d) const; + DDim operator*(DDim d) const; - int size() const; + int size() const; }; /** diff --git a/src/framework/dim.h b/src/framework/dim.h index 892f9dde51c0dcb7452a74b6e630fcb7fbac1d49..5acdaf9f9219986b0001ba587daefc8409b9eace 100644 --- a/src/framework/dim.h +++ b/src/framework/dim.h @@ -25,199 +25,197 @@ namespace framework { // Statically sized, statically indexed dimension template struct Dim { - static constexpr int dimensions = i; + static constexpr int dimensions = i; - template - HOSTDEVICE Dim(int64_t _head, Args... _tail) : head(_head), tail(_tail...) { - static_assert(sizeof...(_tail) == i - 1, - "Dim initialized with the wrong number of parameters"); - } + template + HOSTDEVICE Dim(int64_t _head, Args... _tail) : head(_head), tail(_tail...) { + static_assert(sizeof...(_tail) == i - 1, + "Dim initialized with the wrong number of parameters"); + } - HOSTDEVICE - Dim(int64_t _head, const Dim &_tail) : head(_head), tail(_tail) {} + HOSTDEVICE + Dim(int64_t _head, const Dim &_tail) : head(_head), tail(_tail) {} - HOSTDEVICE - Dim() : head(0), tail() {} + HOSTDEVICE + Dim() : head(0), tail() {} - /** Construct a Dim from a linear index and size. Uses Fortran - * order - * indexing. */ - HOSTDEVICE - Dim(int64_t idx, const Dim &size) - : head(idx % size.head), tail(idx / size.head, size.tail) {} + /** Construct a Dim from a linear index and size. Uses Fortran + * order + * indexing. */ + HOSTDEVICE + Dim(int64_t idx, const Dim &size) + : head(idx % size.head), tail(idx / size.head, size.tail) {} - /** Construct a Dim with each dimension set to the given index */ - HOSTDEVICE - Dim(int64_t idx) : head(idx), tail(idx) {} + /** Construct a Dim with each dimension set to the given index */ + HOSTDEVICE + Dim(int64_t idx) : head(idx), tail(idx) {} - HOSTDEVICE - bool operator==(const Dim &o) const { - return (head == o.head) && (tail == o.tail); - } + HOSTDEVICE + bool operator==(const Dim &o) const { + return (head == o.head) && (tail == o.tail); + } - HOSTDEVICE - bool operator!=(const Dim &o) const { return !(*this == o); } + HOSTDEVICE + bool operator!=(const Dim &o) const { return !(*this == o); } - HOSTDEVICE - int64_t &operator[](int idx); - HOSTDEVICE - int64_t operator[](int idx) const; + HOSTDEVICE + int64_t &operator[](int idx); + HOSTDEVICE + int64_t operator[](int idx) const; - HOST std::string to_string() const; + HOST std::string to_string() const; - int64_t head; - Dim tail; + int64_t head; + Dim tail; }; // Base case specialization template <> struct Dim<0> { - static constexpr int dimensions = 0; + static constexpr int dimensions = 0; - HOSTDEVICE - Dim(int64_t _head) {} + HOSTDEVICE + Dim(int64_t _head) {} - HOSTDEVICE - Dim() {} + HOSTDEVICE + Dim() {} - HOSTDEVICE - Dim(int idx, const Dim<0> &size) { + HOSTDEVICE + Dim(int idx, const Dim<0> &size) { #ifndef __CUDA_ARCH__ - if (idx > 0) { - throw std::invalid_argument("Index out of range."); - } + if (idx > 0) { + throw std::invalid_argument("Index out of range."); + } #else - PADDLE_ASSERT(idx == 0); + PADDLE_ASSERT(idx == 0); #endif - } + } - HOSTDEVICE - bool operator==(const Dim<0> &o) const { return true; } + HOSTDEVICE + bool operator==(const Dim<0> &o) const { return true; } - HOSTDEVICE - bool operator!=(const Dim<0> &o) const { return false; } + HOSTDEVICE + bool operator!=(const Dim<0> &o) const { return false; } - HOSTDEVICE - int64_t &operator[](int idx); - HOSTDEVICE - int64_t operator[](int idx) const; + HOSTDEVICE + int64_t &operator[](int idx); + HOSTDEVICE + int64_t operator[](int idx) const; }; namespace { // Helper for accessing Dim classes template struct DimGetter { - // Return a copy if Dim is const - template HOSTDEVICE static int64_t impl(const D &d) { - return DimGetter::impl(d.tail); - } - // Return a reference if Dim is mutable - template HOSTDEVICE static int64_t &impl(D &d) { - return DimGetter::impl(d.tail); - } + // Return a copy if Dim is const + template HOSTDEVICE static int64_t impl(const D &d) { + return DimGetter::impl(d.tail); + } + // Return a reference if Dim is mutable + template HOSTDEVICE static int64_t &impl(D &d) { + return DimGetter::impl(d.tail); + } }; // Eureka! We found the element! template <> struct DimGetter<0> { - // Return a copy if Dim is const - template HOSTDEVICE static int64_t impl(const D &d) { - return d.head; - } - // Return a reference if Dim is mutable - template HOSTDEVICE static int64_t &impl(D &d) { - return d.head; - } + // Return a copy if Dim is const + template HOSTDEVICE static int64_t impl(const D &d) { + return d.head; + } + // Return a reference if Dim is mutable + template HOSTDEVICE static int64_t &impl(D &d) { return d.head; } }; template HOSTDEVICE int64_t &indexer(Dim &dim, int idx) { #ifndef __CUDA_ARCH__ - if (idx < 0) { - throw std::invalid_argument("Tried to access a negative dimension"); - } + if (idx < 0) { + throw std::invalid_argument("Tried to access a negative dimension"); + } #else - PADDLE_ASSERT(idx >= 0); + PADDLE_ASSERT(idx >= 0); #endif - if (idx == 0) { - return dim.head; - } - return indexer(dim.tail, idx - 1); + if (idx == 0) { + return dim.head; + } + return indexer(dim.tail, idx - 1); } template <> HOSTDEVICE int64_t &indexer<0>(Dim<0> &dim, int idx) { #ifndef __CUDA_ARCH__ - throw std::invalid_argument("Invalid index"); + throw std::invalid_argument("Invalid index"); #else - PADDLE_ASSERT(false); + PADDLE_ASSERT(false); #if CUDA_VERSION < 8000 - // On CUDA versions previous to 8.0, only __shared__ variables - // could be declared as static in the device code. - int64_t head = 0; + // On CUDA versions previous to 8.0, only __shared__ variables + // could be declared as static in the device code. + int64_t head = 0; #else - static int64_t head = 0; + static int64_t head = 0; #endif - return head; + return head; #endif } template HOSTDEVICE int64_t indexer(const Dim &dim, int idx) { #ifndef __CUDA_ARCH__ - if (idx < 0) { - throw std::invalid_argument("Tried to access a negative dimension"); - } + if (idx < 0) { + throw std::invalid_argument("Tried to access a negative dimension"); + } #else - PADDLE_ASSERT(idx >= 0); + PADDLE_ASSERT(idx >= 0); #endif - if (idx == 0) { - return dim.head; - } - return indexer(dim.tail, idx - 1); + if (idx == 0) { + return dim.head; + } + return indexer(dim.tail, idx - 1); } template <> HOSTDEVICE int64_t indexer<0>(const Dim<0> &dim, int idx) { #ifndef __CUDA_ARCH__ - throw std::invalid_argument("Invalid index"); + throw std::invalid_argument("Invalid index"); #else - PADDLE_ASSERT(false); + PADDLE_ASSERT(false); #if CUDA_VERSION < 8000 - // On CUDA versions previous to 8.0, only __shared__ variables - // could be declared as static in the device code. - int64_t head = 0; + // On CUDA versions previous to 8.0, only __shared__ variables + // could be declared as static in the device code. + int64_t head = 0; #else - static int64_t head = 0; + static int64_t head = 0; #endif - return head; + return head; #endif } } // namespace // Static access to constant Dim template HOSTDEVICE int64_t get(const Dim &d) { - return DimGetter::impl(d); + return DimGetter::impl(d); } // Static access to mutable Dim template HOSTDEVICE int64_t &get(Dim &d) { - return DimGetter::impl(d); + return DimGetter::impl(d); } // Dynamic access to constant Dim template HOSTDEVICE int64_t Dim::operator[](int i) const { - // std::cout << "l: " << l << std::endl; - return indexer(*this, i); + // std::cout << "l: " << l << std::endl; + return indexer(*this, i); } // Dynamic access to mutable Dim template HOSTDEVICE int64_t &Dim::operator[](int i) { - return indexer(*this, i); + return indexer(*this, i); } // Dynamic access to constant Dim inline HOSTDEVICE int64_t Dim<0>::operator[](int i) const { - return indexer(*this, i); + return indexer(*this, i); } // Dynamic access to mutable Dim inline HOSTDEVICE int64_t &Dim<0>::operator[](int i) { - return indexer(*this, i); + return indexer(*this, i); } // Dynamic access to constant Dim @@ -225,52 +223,52 @@ inline HOSTDEVICE int64_t &Dim<0>::operator[](int i) { template HOSTDEVICE typename std::enable_if<(l > 0), int64_t>::type get(const Dim &d, int i) { - return d[i]; + return d[i]; } // Dynamic access to mutable Dim template HOSTDEVICE typename std::enable_if<(l > 0), int64_t &>::type get(Dim &d, int i) { - return d[i]; + return d[i]; } // Dot product of two dims template HOSTDEVICE int64_t linearize(const Dim &a, const Dim &b) { - return a.head * b.head + linearize(a.tail, b.tail); + return a.head * b.head + linearize(a.tail, b.tail); } // Base case dot product of two Dims // Notice it is inline because it is no longer a template template <> HOSTDEVICE inline int64_t linearize(const Dim<0> &a, const Dim<0> &b) { - return 0; + return 0; } // Product of a Dim template HOSTDEVICE int64_t product(const Dim &a, int prod = 1) { - return prod * a.head * product(a.tail); + return prod * a.head * product(a.tail); } // Base case product of a Dim // Notice it is inline because it is no longer a template template <> HOSTDEVICE inline int64_t product(const Dim<0> &a, int prod) { - return prod; + return prod; } // Is 0 <= idx_i < size_i for all i? template HOSTDEVICE bool contained(const Dim &idx, const Dim &size) { - return ((0 <= idx.head) && (idx.head < size.head) && - contained(idx.tail, size.tail)); + return ((0 <= idx.head) && (idx.head < size.head) && + contained(idx.tail, size.tail)); } // Base case of is 0 <= idx_i < size_i ? // Notice it is inline because it is no longer a template template <> HOSTDEVICE inline bool contained(const Dim<0> &idx, const Dim<0> &size) { - return true; + return true; } /** @@ -278,14 +276,14 @@ HOSTDEVICE inline bool contained(const Dim<0> &idx, const Dim<0> &size) { */ template HOSTDEVICE Dim ex_prefix_mul(const Dim &src, int mul = 1) { - return Dim(mul, ex_prefix_mul(src.tail, mul * src.head)); + return Dim(mul, ex_prefix_mul(src.tail, mul * src.head)); } ///\cond HIDDEN // Base case of ex_prefix_mul // Notice it is inline because it is no longer a template template <> HOSTDEVICE inline Dim<0> ex_prefix_mul(const Dim<0> &src, int mul) { - return Dim<0>(); + return Dim<0>(); } ///\endcond @@ -293,36 +291,36 @@ template <> HOSTDEVICE inline Dim<0> ex_prefix_mul(const Dim<0> &src, int mul) { * Add two dimensions together */ template HOSTDEVICE Dim dim_plus(const Dim &a, const Dim &b) { - return Dim(a.head + b.head, dim_plus(a.tail, b.tail)); + return Dim(a.head + b.head, dim_plus(a.tail, b.tail)); } // Base case template <> HOSTDEVICE inline Dim<0> dim_plus(const Dim<0> &a, const Dim<0> &b) { - return Dim<0>(); + return Dim<0>(); } template HOSTDEVICE Dim operator+(const Dim &lhs, const Dim &rhs) { - return dim_plus(lhs, rhs); + return dim_plus(lhs, rhs); } /** * Multiply two dimensions together */ template HOSTDEVICE Dim dim_mult(const Dim &a, const Dim &b) { - return Dim(a.head * b.head, dim_mult(a.tail, b.tail)); + return Dim(a.head * b.head, dim_mult(a.tail, b.tail)); } // Base case template <> HOSTDEVICE inline Dim<0> dim_mult(const Dim<0> &a, const Dim<0> &b) { - return Dim<0>(); + return Dim<0>(); } template HOSTDEVICE Dim operator*(const Dim &lhs, const Dim &rhs) { - return dim_mult(lhs, rhs); + return dim_mult(lhs, rhs); } /** @@ -337,8 +335,8 @@ HOSTDEVICE Dim operator*(const Dim &lhs, const Dim &rhs) { template HOSTDEVICE Dim normalize_strides(const Dim &size, const Dim &stride) { - int norm_stride = size.head == 1 ? 0 : stride.head; - return Dim(norm_stride, normalize_strides(size.tail, stride.tail)); + int norm_stride = size.head == 1 ? 0 : stride.head; + return Dim(norm_stride, normalize_strides(size.tail, stride.tail)); } ///\cond HIDDEN @@ -346,7 +344,7 @@ HOSTDEVICE Dim normalize_strides(const Dim &size, const Dim &stride) { template <> HOSTDEVICE inline Dim<0> normalize_strides(const Dim<0> &size, const Dim<0> &stride) { - return Dim<0>(); + return Dim<0>(); } ///\endcond @@ -361,7 +359,7 @@ HOSTDEVICE inline Dim<0> normalize_strides(const Dim<0> &size, template HOSTDEVICE Dim make_dim(Args... idxes) { - return Dim(idxes...); + return Dim(idxes...); } // Allows us to output a Dim @@ -369,8 +367,8 @@ HOSTDEVICE Dim make_dim(Args... idxes) { template typename std::enable_if<(i > 1), std::ostream &>::type operator<<(std::ostream &os, const Dim &d) { - os << d.head << ", " << d.tail; - return os; + os << d.head << ", " << d.tail; + return os; } // Base case that allows us to output a Dim @@ -378,34 +376,34 @@ operator<<(std::ostream &os, const Dim &d) { template typename std::enable_if<(i == 1), std::ostream &>::type operator<<(std::ostream &os, const Dim &d) { - os << d.head; - return os; + os << d.head; + return os; } inline std::ostream &operator<<(std::ostream &os, const Dim<0> &d) { - return os; + return os; } template HOST std::string Dim::to_string() const { - std::stringstream stream; + std::stringstream stream; - stream << *this; + stream << *this; - return stream.str(); + return stream.str(); } template HOSTDEVICE Dim linear_to_dimension(int linear_index, Dim extents) { - Dim result; + Dim result; - for (int i = 0; i < D - 1; ++i) { - result[i] = linear_index % extents[i]; - linear_index /= extents[i]; - } + for (int i = 0; i < D - 1; ++i) { + result[i] = linear_index % extents[i]; + linear_index /= extents[i]; + } - result[D - 1] = linear_index; + result[D - 1] = linear_index; - return result; + return result; } } // namespace framework diff --git a/src/framework/executor.cpp b/src/framework/executor.cpp index 2b60527846714bc8beba1f712ac5c7b00807386d..a57afdd617aa4187933c8d39942112335243a1e1 100644 --- a/src/framework/executor.cpp +++ b/src/framework/executor.cpp @@ -26,66 +26,66 @@ namespace framework { template Executor::Executor(const Program p) : program_(p) { - if (use_optimize_) { - to_predict_program_ = program_.optimizeProgram; - } else { - to_predict_program_ = program_.originProgram; - } + if (use_optimize_) { + to_predict_program_ = program_.optimizeProgram; + } else { + to_predict_program_ = program_.originProgram; + } - // const std::vector> blocks = - to_predict_program_->Blocks(); - // for (int i = 0; i < blocks.size(); ++i) { - // std::shared_ptr block_desc = blocks[i]; - // std::vector> ops = block_desc->Ops(); - // for (int j = 0; j < ops.size(); ++j) { - // std::shared_ptr op = ops[j]; - // if (op->Type() == "conv2d" && op->Input("Input")[0] == - // "pixel") { - // Attribute strides_attr = op->GetAttrMap().at("strides"); - // std::vector stride = - // strides_attr.Get>(); for (int k = 0; k < - // stride.size(); ++k) { - // } - // std::shared_ptr> conv = - // std::make_shared>( - // op->Type(), op->GetInputs(), op->GetOutputs(), - // op->GetAttrMap(), program_.scope); - // ops_of_block_[*block_desc.get()].push_back(conv); - // } - // } - // } + // const std::vector> blocks = + to_predict_program_->Blocks(); + // for (int i = 0; i < blocks.size(); ++i) { + // std::shared_ptr block_desc = blocks[i]; + // std::vector> ops = block_desc->Ops(); + // for (int j = 0; j < ops.size(); ++j) { + // std::shared_ptr op = ops[j]; + // if (op->Type() == "conv2d" && op->Input("Input")[0] == + // "pixel") { + // Attribute strides_attr = op->GetAttrMap().at("strides"); + // std::vector stride = + // strides_attr.Get>(); for (int k = 0; k < + // stride.size(); ++k) { + // } + // std::shared_ptr> conv = + // std::make_shared>( + // op->Type(), op->GetInputs(), op->GetOutputs(), + // op->GetAttrMap(), program_.scope); + // ops_of_block_[*block_desc.get()].push_back(conv); + // } + // } + // } } template std::shared_ptr Executor::predict(Tensor &t) { - // feed - auto scope = program_.scope; - Variable *g_feed_value = scope->Var("pixel"); - auto tensor = g_feed_value->GetMutable(); - tensor->ShareDataWith(t); + // feed + auto scope = program_.scope; + Variable *g_feed_value = scope->Var("pixel"); + auto tensor = g_feed_value->GetMutable(); + tensor->ShareDataWith(t); - Variable *con_output = scope->Var("conv2d_0.tmp_0"); - Tensor *output_tensor = con_output->GetMutable(); - output_tensor->mutable_data({1, 16, 32, 32}); - // std::cout << typeid(output_tensor).name() << std::endl; - // std::cout << "output_tensor dims: " << output_tensor->dims() << - // std::endl; + Variable *con_output = scope->Var("conv2d_0.tmp_0"); + Tensor *output_tensor = con_output->GetMutable(); + output_tensor->mutable_data({1, 16, 32, 32}); + // std::cout << typeid(output_tensor).name() << std::endl; + // std::cout << "output_tensor dims: " << output_tensor->dims() << + // std::endl; - std::shared_ptr out_tensor = std::make_shared(); - out_tensor.reset(output_tensor); + std::shared_ptr out_tensor = std::make_shared(); + out_tensor.reset(output_tensor); - predict(t, 0); - return out_tensor; + predict(t, 0); + return out_tensor; } template void Executor::predict(const Tensor &t, int block_id) { - std::shared_ptr to_predict_block = - to_predict_program_->Block(block_id); - for (int j = 0; j < ops_of_block_[*to_predict_block.get()].size(); ++j) { - auto op = ops_of_block_[*to_predict_block.get()][j]; - op->Run(); - } + std::shared_ptr to_predict_block = + to_predict_program_->Block(block_id); + for (int j = 0; j < ops_of_block_[*to_predict_block.get()].size(); ++j) { + auto op = ops_of_block_[*to_predict_block.get()][j]; + op->Run(); + } } template class Executor; diff --git a/src/framework/executor.h b/src/framework/executor.h index 7500d67050c3369fc1c1b05cd61a7cedcac7169f..951835bc244955ff8778c9d4e5f109b560cdec0c 100644 --- a/src/framework/executor.h +++ b/src/framework/executor.h @@ -35,23 +35,23 @@ namespace paddle_mobile { namespace framework { template class Executor { - public: - Executor(); +public: + Executor(); - Executor(const Program p); + Executor(const Program p); - std::shared_ptr predict(Tensor &t); + std::shared_ptr predict(Tensor &t); - public: - const framework::Program program_; - std::shared_ptr to_predict_program_; +public: + const framework::Program program_; + std::shared_ptr to_predict_program_; - void predict(const Tensor &t, int block_id); + void predict(const Tensor &t, int block_id); - std::map>>> - ops_of_block_; - bool use_optimize_ = false; + std::map>>> + ops_of_block_; + bool use_optimize_ = false; }; } // namespace framework diff --git a/src/framework/framework.pb.cpp b/src/framework/framework.pb.cpp index e7b5a1e52df66a83921dfb843de13406e61eaed5..c4d0ea759849641f8845b1fa3af2f7115e5903f4 100644 --- a/src/framework/framework.pb.cpp +++ b/src/framework/framework.pb.cpp @@ -18,75 +18,74 @@ namespace paddle_mobile { namespace framework { namespace proto { class OpDesc_AttrDefaultTypeInternal { - public: - ::google::protobuf::internal::ExplicitlyConstructed _instance; +public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; } _OpDesc_Attr_default_instance_; class OpDesc_VarDefaultTypeInternal { - public: - ::google::protobuf::internal::ExplicitlyConstructed _instance; +public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; } _OpDesc_Var_default_instance_; class OpDescDefaultTypeInternal { - public: - ::google::protobuf::internal::ExplicitlyConstructed _instance; +public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; } _OpDesc_default_instance_; class OpProto_VarDefaultTypeInternal { - public: - ::google::protobuf::internal::ExplicitlyConstructed _instance; +public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; } _OpProto_Var_default_instance_; class OpProto_AttrDefaultTypeInternal { - public: - ::google::protobuf::internal::ExplicitlyConstructed _instance; +public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; } _OpProto_Attr_default_instance_; class OpProtoDefaultTypeInternal { - public: - ::google::protobuf::internal::ExplicitlyConstructed _instance; +public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; } _OpProto_default_instance_; class VarType_TensorDescDefaultTypeInternal { - public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; +public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _VarType_TensorDesc_default_instance_; class VarType_LoDTensorDescDefaultTypeInternal { - public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; +public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _VarType_LoDTensorDesc_default_instance_; class VarType_LoDTensorArrayDescDefaultTypeInternal { - public: - ::google::protobuf::internal::ExplicitlyConstructed< - VarType_LoDTensorArrayDesc> - _instance; +public: + ::google::protobuf::internal::ExplicitlyConstructed< + VarType_LoDTensorArrayDesc> + _instance; } _VarType_LoDTensorArrayDesc_default_instance_; class VarType_ReaderDescDefaultTypeInternal { - public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; +public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _VarType_ReaderDesc_default_instance_; class VarType_ChannelDescDefaultTypeInternal { - public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; +public: + ::google::protobuf::internal::ExplicitlyConstructed + _instance; } _VarType_ChannelDesc_default_instance_; class VarType_TupleDefaultTypeInternal { - public: - ::google::protobuf::internal::ExplicitlyConstructed - _instance; +public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; } _VarType_Tuple_default_instance_; class VarTypeDefaultTypeInternal { - public: - ::google::protobuf::internal::ExplicitlyConstructed _instance; +public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; } _VarType_default_instance_; class VarDescDefaultTypeInternal { - public: - ::google::protobuf::internal::ExplicitlyConstructed _instance; +public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; } _VarDesc_default_instance_; class BlockDescDefaultTypeInternal { - public: - ::google::protobuf::internal::ExplicitlyConstructed _instance; +public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; } _BlockDesc_default_instance_; class ProgramDescDefaultTypeInternal { - public: - ::google::protobuf::internal::ExplicitlyConstructed _instance; +public: + ::google::protobuf::internal::ExplicitlyConstructed _instance; } _ProgramDesc_default_instance_; namespace protobuf_framework_2eproto { @@ -122,137 +121,136 @@ PROTOBUF_CONSTEXPR_VAR::google::protobuf::internal::ParseTable const }; void TableStruct::InitDefaultsImpl() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - ::google::protobuf::internal::InitProtobufDefaults(); - _OpDesc_Attr_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_OpDesc_Attr_default_instance_); - _OpDesc_Var_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_OpDesc_Var_default_instance_); - _OpDesc_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_OpDesc_default_instance_); - _OpProto_Var_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_OpProto_Var_default_instance_); - _OpProto_Attr_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_OpProto_Attr_default_instance_); - _OpProto_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_OpProto_default_instance_); - _VarType_TensorDesc_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_VarType_TensorDesc_default_instance_); - _VarType_LoDTensorDesc_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_VarType_LoDTensorDesc_default_instance_); - _VarType_LoDTensorArrayDesc_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_VarType_LoDTensorArrayDesc_default_instance_); - _VarType_ReaderDesc_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_VarType_ReaderDesc_default_instance_); - _VarType_ChannelDesc_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_VarType_ChannelDesc_default_instance_); - _VarType_Tuple_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_VarType_Tuple_default_instance_); - _VarType_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_VarType_default_instance_); - _VarDesc_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_VarDesc_default_instance_); - _BlockDesc_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_BlockDesc_default_instance_); - _ProgramDesc_default_instance_._instance.DefaultConstruct(); - ::google::protobuf::internal::OnShutdownDestroyMessage( - &_ProgramDesc_default_instance_); - _VarType_LoDTensorDesc_default_instance_._instance.get_mutable()->tensor_ = - const_cast<::paddle_mobile::framework::proto::VarType_TensorDesc *>( - ::paddle_mobile::framework::proto::VarType_TensorDesc:: - internal_default_instance()); - _VarType_LoDTensorArrayDesc_default_instance_._instance.get_mutable() - ->tensor_ = - const_cast<::paddle_mobile::framework::proto::VarType_TensorDesc *>( - ::paddle_mobile::framework::proto::VarType_TensorDesc:: - internal_default_instance()); - _VarType_default_instance_._instance.get_mutable()->selected_rows_ = - const_cast<::paddle_mobile::framework::proto::VarType_TensorDesc *>( - ::paddle_mobile::framework::proto::VarType_TensorDesc:: - internal_default_instance()); - _VarType_default_instance_._instance.get_mutable()->lod_tensor_ = - const_cast<::paddle_mobile::framework::proto::VarType_LoDTensorDesc *>( - ::paddle_mobile::framework::proto::VarType_LoDTensorDesc:: - internal_default_instance()); - _VarType_default_instance_._instance.get_mutable()->tensor_array_ = - const_cast< - ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc *>( - ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc:: - internal_default_instance()); - _VarType_default_instance_._instance.get_mutable()->reader_ = - const_cast<::paddle_mobile::framework::proto::VarType_ReaderDesc *>( - ::paddle_mobile::framework::proto::VarType_ReaderDesc:: - internal_default_instance()); - _VarType_default_instance_._instance.get_mutable()->channel_ = - const_cast<::paddle_mobile::framework::proto::VarType_ChannelDesc *>( - ::paddle_mobile::framework::proto::VarType_ChannelDesc:: - internal_default_instance()); - _VarType_default_instance_._instance.get_mutable()->tuple_ = - const_cast<::paddle_mobile::framework::proto::VarType_Tuple *>( - ::paddle_mobile::framework::proto::VarType_Tuple:: - internal_default_instance()); - _VarDesc_default_instance_._instance.get_mutable()->type_ = - const_cast<::paddle_mobile::framework::proto::VarType *>( - ::paddle_mobile::framework::proto::VarType:: - internal_default_instance()); + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::internal::InitProtobufDefaults(); + _OpDesc_Attr_default_instance_._instance.DefaultConstruct(); + ::google::protobuf::internal::OnShutdownDestroyMessage( + &_OpDesc_Attr_default_instance_); + _OpDesc_Var_default_instance_._instance.DefaultConstruct(); + ::google::protobuf::internal::OnShutdownDestroyMessage( + &_OpDesc_Var_default_instance_); + _OpDesc_default_instance_._instance.DefaultConstruct(); + ::google::protobuf::internal::OnShutdownDestroyMessage( + &_OpDesc_default_instance_); + _OpProto_Var_default_instance_._instance.DefaultConstruct(); + ::google::protobuf::internal::OnShutdownDestroyMessage( + &_OpProto_Var_default_instance_); + _OpProto_Attr_default_instance_._instance.DefaultConstruct(); + ::google::protobuf::internal::OnShutdownDestroyMessage( + &_OpProto_Attr_default_instance_); + _OpProto_default_instance_._instance.DefaultConstruct(); + ::google::protobuf::internal::OnShutdownDestroyMessage( + &_OpProto_default_instance_); + _VarType_TensorDesc_default_instance_._instance.DefaultConstruct(); + ::google::protobuf::internal::OnShutdownDestroyMessage( + &_VarType_TensorDesc_default_instance_); + _VarType_LoDTensorDesc_default_instance_._instance.DefaultConstruct(); + ::google::protobuf::internal::OnShutdownDestroyMessage( + &_VarType_LoDTensorDesc_default_instance_); + _VarType_LoDTensorArrayDesc_default_instance_._instance.DefaultConstruct(); + ::google::protobuf::internal::OnShutdownDestroyMessage( + &_VarType_LoDTensorArrayDesc_default_instance_); + _VarType_ReaderDesc_default_instance_._instance.DefaultConstruct(); + ::google::protobuf::internal::OnShutdownDestroyMessage( + &_VarType_ReaderDesc_default_instance_); + _VarType_ChannelDesc_default_instance_._instance.DefaultConstruct(); + ::google::protobuf::internal::OnShutdownDestroyMessage( + &_VarType_ChannelDesc_default_instance_); + _VarType_Tuple_default_instance_._instance.DefaultConstruct(); + ::google::protobuf::internal::OnShutdownDestroyMessage( + &_VarType_Tuple_default_instance_); + _VarType_default_instance_._instance.DefaultConstruct(); + ::google::protobuf::internal::OnShutdownDestroyMessage( + &_VarType_default_instance_); + _VarDesc_default_instance_._instance.DefaultConstruct(); + ::google::protobuf::internal::OnShutdownDestroyMessage( + &_VarDesc_default_instance_); + _BlockDesc_default_instance_._instance.DefaultConstruct(); + ::google::protobuf::internal::OnShutdownDestroyMessage( + &_BlockDesc_default_instance_); + _ProgramDesc_default_instance_._instance.DefaultConstruct(); + ::google::protobuf::internal::OnShutdownDestroyMessage( + &_ProgramDesc_default_instance_); + _VarType_LoDTensorDesc_default_instance_._instance.get_mutable()->tensor_ = + const_cast<::paddle_mobile::framework::proto::VarType_TensorDesc *>( + ::paddle_mobile::framework::proto::VarType_TensorDesc:: + internal_default_instance()); + _VarType_LoDTensorArrayDesc_default_instance_._instance.get_mutable() + ->tensor_ = + const_cast<::paddle_mobile::framework::proto::VarType_TensorDesc *>( + ::paddle_mobile::framework::proto::VarType_TensorDesc:: + internal_default_instance()); + _VarType_default_instance_._instance.get_mutable()->selected_rows_ = + const_cast<::paddle_mobile::framework::proto::VarType_TensorDesc *>( + ::paddle_mobile::framework::proto::VarType_TensorDesc:: + internal_default_instance()); + _VarType_default_instance_._instance.get_mutable()->lod_tensor_ = + const_cast<::paddle_mobile::framework::proto::VarType_LoDTensorDesc *>( + ::paddle_mobile::framework::proto::VarType_LoDTensorDesc:: + internal_default_instance()); + _VarType_default_instance_._instance.get_mutable()->tensor_array_ = + const_cast< + ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc *>( + ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc:: + internal_default_instance()); + _VarType_default_instance_._instance.get_mutable()->reader_ = + const_cast<::paddle_mobile::framework::proto::VarType_ReaderDesc *>( + ::paddle_mobile::framework::proto::VarType_ReaderDesc:: + internal_default_instance()); + _VarType_default_instance_._instance.get_mutable()->channel_ = + const_cast<::paddle_mobile::framework::proto::VarType_ChannelDesc *>( + ::paddle_mobile::framework::proto::VarType_ChannelDesc:: + internal_default_instance()); + _VarType_default_instance_._instance.get_mutable()->tuple_ = + const_cast<::paddle_mobile::framework::proto::VarType_Tuple *>( + ::paddle_mobile::framework::proto::VarType_Tuple:: + internal_default_instance()); + _VarDesc_default_instance_._instance.get_mutable() + ->type_ = const_cast<::paddle_mobile::framework::proto::VarType *>( + ::paddle_mobile::framework::proto::VarType::internal_default_instance()); } void InitDefaults() { - static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); } namespace { void AddDescriptorsImpl() { InitDefaults(); } } // anonymous namespace void AddDescriptors() { - static GOOGLE_PROTOBUF_DECLARE_ONCE(once); - ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); + static GOOGLE_PROTOBUF_DECLARE_ONCE(once); + ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); } } // namespace protobuf_framework_2eproto bool VarType_Type_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - return true; - default: - return false; - } + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + return true; + default: + return false; + } } #if !defined(_MSC_VER) || _MSC_VER >= 1900 @@ -280,24 +278,24 @@ const VarType_Type VarType::Type_MAX; const int VarType::Type_ARRAYSIZE; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 bool AttrType_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - return true; - default: - return false; - } + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + return true; + default: + return false; + } } - // =================================================================== + // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int OpDesc_Attr::kNameFieldNumber; @@ -316,666 +314,644 @@ const int OpDesc_Attr::kLFieldNumber; OpDesc_Attr::OpDesc_Attr() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_framework_2eproto::InitDefaults(); - } - SharedCtor(); - // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.OpDesc.Attr) + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + protobuf_framework_2eproto::InitDefaults(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.OpDesc.Attr) } OpDesc_Attr::OpDesc_Attr(const OpDesc_Attr &from) : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0), ints_(from.ints_), floats_(from.floats_), strings_(from.strings_), bools_(from.bools_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - name_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.has_name()) { - name_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.name_); - } - s_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.has_s()) { - s_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.s_); - } - ::memcpy(&type_, &from.type_, - static_cast(reinterpret_cast(&block_idx_) - - reinterpret_cast(&type_)) + - sizeof(block_idx_)); - // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.OpDesc.Attr) + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_name()) { + name_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.name_); + } + s_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_s()) { + s_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.s_); + } + ::memcpy(&type_, &from.type_, + static_cast(reinterpret_cast(&block_idx_) - + reinterpret_cast(&type_)) + + sizeof(block_idx_)); + // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.OpDesc.Attr) } void OpDesc_Attr::SharedCtor() { - _cached_size_ = 0; - name_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - s_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - ::memset(&type_, 0, - static_cast(reinterpret_cast(&block_idx_) - - reinterpret_cast(&type_)) + - sizeof(block_idx_)); + _cached_size_ = 0; + name_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + s_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&type_, 0, + static_cast(reinterpret_cast(&block_idx_) - + reinterpret_cast(&type_)) + + sizeof(block_idx_)); } OpDesc_Attr::~OpDesc_Attr() { - // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.OpDesc.Attr) - SharedDtor(); + // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.OpDesc.Attr) + SharedDtor(); } void OpDesc_Attr::SharedDtor() { - name_.DestroyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - s_.DestroyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + s_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void OpDesc_Attr::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const OpDesc_Attr &OpDesc_Attr::default_instance() { - protobuf_framework_2eproto::InitDefaults(); - return *internal_default_instance(); + protobuf_framework_2eproto::InitDefaults(); + return *internal_default_instance(); } OpDesc_Attr *OpDesc_Attr::New(::google::protobuf::Arena *arena) const { - OpDesc_Attr *n = new OpDesc_Attr; - if (arena != NULL) { - arena->Own(n); - } - return n; + OpDesc_Attr *n = new OpDesc_Attr; + if (arena != NULL) { + arena->Own(n); + } + return n; } void OpDesc_Attr::Clear() { - // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.OpDesc.Attr) - ::google::protobuf::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void)cached_has_bits; - - ints_.Clear(); - floats_.Clear(); - strings_.Clear(); - bools_.Clear(); - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 3u) { - if (cached_has_bits & 0x00000001u) { - GOOGLE_DCHECK(!name_.IsDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*name_.UnsafeRawStringPointer())->clear(); - } - if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(!s_.IsDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*s_.UnsafeRawStringPointer())->clear(); - } + // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.OpDesc.Attr) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ints_.Clear(); + floats_.Clear(); + strings_.Clear(); + bools_.Clear(); + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 3u) { + if (cached_has_bits & 0x00000001u) { + GOOGLE_DCHECK(!name_.IsDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited())); + (*name_.UnsafeRawStringPointer())->clear(); } - if (cached_has_bits & 252u) { - ::memset(&type_, 0, - static_cast(reinterpret_cast(&block_idx_) - - reinterpret_cast(&type_)) + - sizeof(block_idx_)); + if (cached_has_bits & 0x00000002u) { + GOOGLE_DCHECK(!s_.IsDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited())); + (*s_.UnsafeRawStringPointer())->clear(); } - _has_bits_.Clear(); - _internal_metadata_.Clear(); + } + if (cached_has_bits & 252u) { + ::memset(&type_, 0, + static_cast(reinterpret_cast(&block_idx_) - + reinterpret_cast(&type_)) + + sizeof(block_idx_)); + } + _has_bits_.Clear(); + _internal_metadata_.Clear(); } bool OpDesc_Attr::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::NewPermanentCallback( - &_internal_metadata_, - &::google::protobuf::internal::InternalMetadataWithArenaLite:: - mutable_unknown_fields)); - ::google::protobuf::io::CodedOutputStream unknown_fields_stream( - &unknown_fields_string, false); - // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.OpDesc.Attr) - for (;;) { - ::std::pair<::google::protobuf::uint32, bool> p = - input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) - goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber( - tag)) { - // required string name = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_name())); - } else { - goto handle_unusual; - } - break; - } - - // required .paddle_mobile.framework.proto.AttrType type = - // 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { - int value; - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - int, ::google::protobuf::internal::WireFormatLite:: - TYPE_ENUM>(input, &value))); - if (::paddle_mobile::framework::proto::AttrType_IsValid( - value)) { - set_type(static_cast< - ::paddle_mobile::framework::proto::AttrType>( - value)); - } else { - unknown_fields_stream.WriteVarint32(16u); - unknown_fields_stream.WriteVarint32( - static_cast<::google::protobuf::uint32>(value)); - } - } else { - goto handle_unusual; - } - break; - } - - // optional int32 i = 3; - case 3: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { - set_has_i(); - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int32, - ::google::protobuf::internal::WireFormatLite:: - TYPE_INT32>(input, &i_))); - } else { - goto handle_unusual; - } - break; - } - - // optional float f = 4; - case 4: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(37u /* 37 & 0xFF */)) { - set_has_f(); - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - float, ::google::protobuf::internal::WireFormatLite:: - TYPE_FLOAT>(input, &f_))); - } else { - goto handle_unusual; - } - break; - } - - // optional string s = 5; - case 5: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_s())); - } else { - goto handle_unusual; - } - break; - } - - // repeated int32 ints = 6; - case 6: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { - DO_((::google::protobuf::internal::WireFormatLite:: - ReadRepeatedPrimitive<::google::protobuf::int32, - ::google::protobuf::internal:: - WireFormatLite::TYPE_INT32>( - 1, 48u, input, this->mutable_ints()))); - } else if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>( - 50u /* 50 & 0xFF */)) { - DO_((::google::protobuf::internal::WireFormatLite:: - ReadPackedPrimitiveNoInline< - ::google::protobuf::int32, - ::google::protobuf::internal::WireFormatLite:: - TYPE_INT32>(input, this->mutable_ints()))); - } else { - goto handle_unusual; - } - break; - } - - // repeated float floats = 7; - case 7: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(61u /* 61 & 0xFF */)) { - DO_((::google::protobuf::internal::WireFormatLite:: - ReadRepeatedPrimitive( - 1, 61u, input, this->mutable_floats()))); - } else if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>( - 58u /* 58 & 0xFF */)) { - DO_((::google::protobuf::internal::WireFormatLite:: - ReadPackedPrimitiveNoInline< - float, ::google::protobuf::internal:: - WireFormatLite::TYPE_FLOAT>( - input, this->mutable_floats()))); - } else { - goto handle_unusual; - } - break; - } - - // repeated string strings = 8; - case 8: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->add_strings())); - } else { - goto handle_unusual; - } - break; - } - - // optional bool b = 10; - case 10: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(80u /* 80 & 0xFF */)) { - set_has_b(); - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - bool, ::google::protobuf::internal::WireFormatLite:: - TYPE_BOOL>(input, &b_))); - } else { - goto handle_unusual; - } - break; - } - - // repeated bool bools = 11; - case 11: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(88u /* 88 & 0xFF */)) { - DO_((::google::protobuf::internal::WireFormatLite:: - ReadRepeatedPrimitive( - 1, 88u, input, this->mutable_bools()))); - } else if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>( - 90u /* 90 & 0xFF */)) { - DO_((::google::protobuf::internal::WireFormatLite:: - ReadPackedPrimitiveNoInline< - bool, ::google::protobuf::internal:: - WireFormatLite::TYPE_BOOL>( - input, this->mutable_bools()))); - } else { - goto handle_unusual; - } - break; - } - - // optional int32 block_idx = 12; - case 12: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(96u /* 96 & 0xFF */)) { - set_has_block_idx(); - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int32, - ::google::protobuf::internal::WireFormatLite:: - TYPE_INT32>(input, &block_idx_))); - } else { - goto handle_unusual; - } - break; - } - - // optional int64 l = 13; - case 13: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(104u /* 104 & 0xFF */)) { - set_has_l(); - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int64, - ::google::protobuf::internal::WireFormatLite:: - TYPE_INT64>(input, &l_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.OpDesc.Attr) - return true; -failure: - // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.OpDesc.Attr) - return false; -#undef DO_ -} - -void OpDesc_Attr::SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream *output) const { - // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.OpDesc.Attr) - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _has_bits_[0]; + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ + goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::NewPermanentCallback( + &_internal_metadata_, + &::google::protobuf::internal::InternalMetadataWithArenaLite:: + mutable_unknown_fields)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.OpDesc.Attr) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = + input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) + goto handle_unusual; + switch ( + ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required string name = 1; - if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->name(), output); - } - - // required .paddle_mobile.framework.proto.AttrType type = 2; - if (cached_has_bits & 0x00000004u) { - ::google::protobuf::internal::WireFormatLite::WriteEnum(2, this->type(), - output); + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + } else { + goto handle_unusual; + } + break; + } + + // required .paddle_mobile.framework.proto.AttrType type = + // 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::paddle_mobile::framework::proto::AttrType_IsValid(value)) { + set_type( + static_cast<::paddle_mobile::framework::proto::AttrType>(value)); + } else { + unknown_fields_stream.WriteVarint32(16u); + unknown_fields_stream.WriteVarint32( + static_cast<::google::protobuf::uint32>(value)); + } + } else { + goto handle_unusual; + } + break; } // optional int32 i = 3; - if (cached_has_bits & 0x00000008u) { - ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->i(), - output); + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + set_has_i(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, + ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(input, + &i_))); + } else { + goto handle_unusual; + } + break; } // optional float f = 4; - if (cached_has_bits & 0x00000010u) { - ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->f(), - output); + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(37u /* 37 & 0xFF */)) { + set_has_f(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &f_))); + } else { + goto handle_unusual; + } + break; } // optional string s = 5; - if (cached_has_bits & 0x00000002u) { - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 5, this->s(), output); + case 5: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_s())); + } else { + goto handle_unusual; + } + break; } // repeated int32 ints = 6; - for (int i = 0, n = this->ints_size(); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteInt32( - 6, this->ints(i), output); + case 6: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(48u /* 48 & 0xFF */)) { + DO_(( + ::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::int32, + ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 48u, input, this->mutable_ints()))); + } else if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite:: + ReadPackedPrimitiveNoInline< + ::google::protobuf::int32, + ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_ints()))); + } else { + goto handle_unusual; + } + break; } // repeated float floats = 7; - for (int i = 0, n = this->floats_size(); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteFloat( - 7, this->floats(i), output); + case 7: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(61u /* 61 & 0xFF */)) { + DO_(( + ::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + float, + ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + 1, 61u, input, this->mutable_floats()))); + } else if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite:: + ReadPackedPrimitiveNoInline< + float, + ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, this->mutable_floats()))); + } else { + goto handle_unusual; + } + break; } // repeated string strings = 8; - for (int i = 0, n = this->strings_size(); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteString( - 8, this->strings(i), output); + case 8: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(66u /* 66 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_strings())); + } else { + goto handle_unusual; + } + break; } // optional bool b = 10; - if (cached_has_bits & 0x00000020u) { - ::google::protobuf::internal::WireFormatLite::WriteBool(10, this->b(), - output); + case 10: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(80u /* 80 & 0xFF */)) { + set_has_b(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &b_))); + } else { + goto handle_unusual; + } + break; } // repeated bool bools = 11; - for (int i = 0, n = this->bools_size(); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteBool( - 11, this->bools(i), output); + case 11: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(88u /* 88 & 0xFF */)) { + DO_(( + ::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + 1, 88u, input, this->mutable_bools()))); + } else if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(90u /* 90 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite:: + ReadPackedPrimitiveNoInline< + bool, + ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, this->mutable_bools()))); + } else { + goto handle_unusual; + } + break; } // optional int32 block_idx = 12; - if (cached_has_bits & 0x00000080u) { - ::google::protobuf::internal::WireFormatLite::WriteInt32( - 12, this->block_idx(), output); + case 12: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(96u /* 96 & 0xFF */)) { + set_has_block_idx(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, + ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &block_idx_))); + } else { + goto handle_unusual; + } + break; } // optional int64 l = 13; - if (cached_has_bits & 0x00000040u) { - ::google::protobuf::internal::WireFormatLite::WriteInt64(13, this->l(), - output); - } + case 13: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(104u /* 104 & 0xFF */)) { + set_has_l(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, + ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(input, + &l_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.OpDesc.Attr) + return true; +failure: + // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.OpDesc.Attr) + return false; +#undef DO_ +} - output->WriteRaw( - _internal_metadata_.unknown_fields().data(), - static_cast(_internal_metadata_.unknown_fields().size())); - // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.OpDesc.Attr) +void OpDesc_Attr::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream *output) const { + // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.OpDesc.Attr) + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required string name = 1; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // required .paddle_mobile.framework.proto.AttrType type = 2; + if (cached_has_bits & 0x00000004u) { + ::google::protobuf::internal::WireFormatLite::WriteEnum(2, this->type(), + output); + } + + // optional int32 i = 3; + if (cached_has_bits & 0x00000008u) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->i(), + output); + } + + // optional float f = 4; + if (cached_has_bits & 0x00000010u) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->f(), + output); + } + + // optional string s = 5; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 5, this->s(), output); + } + + // repeated int32 ints = 6; + for (int i = 0, n = this->ints_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->ints(i), + output); + } + + // repeated float floats = 7; + for (int i = 0, n = this->floats_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(7, this->floats(i), + output); + } + + // repeated string strings = 8; + for (int i = 0, n = this->strings_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteString( + 8, this->strings(i), output); + } + + // optional bool b = 10; + if (cached_has_bits & 0x00000020u) { + ::google::protobuf::internal::WireFormatLite::WriteBool(10, this->b(), + output); + } + + // repeated bool bools = 11; + for (int i = 0, n = this->bools_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteBool(11, this->bools(i), + output); + } + + // optional int32 block_idx = 12; + if (cached_has_bits & 0x00000080u) { + ::google::protobuf::internal::WireFormatLite::WriteInt32( + 12, this->block_idx(), output); + } + + // optional int64 l = 13; + if (cached_has_bits & 0x00000040u) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(13, this->l(), + output); + } + + output->WriteRaw( + _internal_metadata_.unknown_fields().data(), + static_cast(_internal_metadata_.unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.OpDesc.Attr) } size_t OpDesc_Attr::RequiredFieldsByteSizeFallback() const { - // @@protoc_insertion_point(required_fields_byte_size_fallback_start:paddle_mobile.framework.proto.OpDesc.Attr) - size_t total_size = 0; + // @@protoc_insertion_point(required_fields_byte_size_fallback_start:paddle_mobile.framework.proto.OpDesc.Attr) + size_t total_size = 0; - if (has_name()) { - // required string name = 1; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->name()); - } + if (has_name()) { + // required string name = 1; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } - if (has_type()) { - // required .paddle_mobile.framework.proto.AttrType type = - // 2; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::EnumSize( - this->type()); - } + if (has_type()) { + // required .paddle_mobile.framework.proto.AttrType type = + // 2; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize( + this->type()); + } - return total_size; + return total_size; } size_t OpDesc_Attr::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.OpDesc.Attr) - size_t total_size = 0; + // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.OpDesc.Attr) + size_t total_size = 0; - total_size += _internal_metadata_.unknown_fields().size(); + total_size += _internal_metadata_.unknown_fields().size(); - if (((_has_bits_[0] & 0x00000005) ^ 0x00000005) == - 0) { // All required fields are present. - // required string name = 1; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->name()); + if (((_has_bits_[0] & 0x00000005) ^ 0x00000005) == + 0) { // All required fields are present. + // required string name = 1; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); - // required .paddle_mobile.framework.proto.AttrType type = - // 2; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::EnumSize( - this->type()); + // required .paddle_mobile.framework.proto.AttrType type = + // 2; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize( + this->type()); + + } else { + total_size += RequiredFieldsByteSizeFallback(); + } + // repeated int32 ints = 6; + { + size_t data_size = + ::google::protobuf::internal::WireFormatLite::Int32Size(this->ints_); + total_size += + 1 * ::google::protobuf::internal::FromIntSize(this->ints_size()); + total_size += data_size; + } + + // repeated float floats = 7; + { + unsigned int count = static_cast(this->floats_size()); + size_t data_size = 4UL * count; + total_size += + 1 * ::google::protobuf::internal::FromIntSize(this->floats_size()); + total_size += data_size; + } + + // repeated string strings = 8; + total_size += + 1 * ::google::protobuf::internal::FromIntSize(this->strings_size()); + for (int i = 0, n = this->strings_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->strings(i)); + } + + // repeated bool bools = 11; + { + unsigned int count = static_cast(this->bools_size()); + size_t data_size = 1UL * count; + total_size += + 1 * ::google::protobuf::internal::FromIntSize(this->bools_size()); + total_size += data_size; + } - } else { - total_size += RequiredFieldsByteSizeFallback(); - } - // repeated int32 ints = 6; - { - size_t data_size = - ::google::protobuf::internal::WireFormatLite::Int32Size( - this->ints_); - total_size += - 1 * ::google::protobuf::internal::FromIntSize(this->ints_size()); - total_size += data_size; - } + // optional string s = 5; + if (has_s()) { + total_size += + 1 + ::google::protobuf::internal::WireFormatLite::StringSize(this->s()); + } - // repeated float floats = 7; - { - unsigned int count = static_cast(this->floats_size()); - size_t data_size = 4UL * count; - total_size += - 1 * ::google::protobuf::internal::FromIntSize(this->floats_size()); - total_size += data_size; + if (_has_bits_[0 / 32] & 248u) { + // optional int32 i = 3; + if (has_i()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->i()); } - // repeated string strings = 8; - total_size += - 1 * ::google::protobuf::internal::FromIntSize(this->strings_size()); - for (int i = 0, n = this->strings_size(); i < n; i++) { - total_size += ::google::protobuf::internal::WireFormatLite::StringSize( - this->strings(i)); + // optional float f = 4; + if (has_f()) { + total_size += 1 + 4; } - // repeated bool bools = 11; - { - unsigned int count = static_cast(this->bools_size()); - size_t data_size = 1UL * count; - total_size += - 1 * ::google::protobuf::internal::FromIntSize(this->bools_size()); - total_size += data_size; + // optional bool b = 10; + if (has_b()) { + total_size += 1 + 1; } - // optional string s = 5; - if (has_s()) { - total_size += - 1 + - ::google::protobuf::internal::WireFormatLite::StringSize(this->s()); - } - - if (_has_bits_[0 / 32] & 248u) { - // optional int32 i = 3; - if (has_i()) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( - this->i()); - } - - // optional float f = 4; - if (has_f()) { - total_size += 1 + 4; - } - - // optional bool b = 10; - if (has_b()) { - total_size += 1 + 1; - } - - // optional int64 l = 13; - if (has_l()) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::Int64Size( - this->l()); - } + // optional int64 l = 13; + if (has_l()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->l()); + } - // optional int32 block_idx = 12; - if (has_block_idx()) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( - this->block_idx()); - } + // optional int32 block_idx = 12; + if (has_block_idx()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->block_idx()); } - int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; } void OpDesc_Attr::CheckTypeAndMergeFrom( const ::google::protobuf::MessageLite &from) { - MergeFrom(*::google::protobuf::down_cast(&from)); + MergeFrom(*::google::protobuf::down_cast(&from)); } void OpDesc_Attr::MergeFrom(const OpDesc_Attr &from) { - // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.OpDesc.Attr) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - ints_.MergeFrom(from.ints_); - floats_.MergeFrom(from.floats_); - strings_.MergeFrom(from.strings_); - bools_.MergeFrom(from.bools_); - cached_has_bits = from._has_bits_[0]; - if (cached_has_bits & 255u) { - if (cached_has_bits & 0x00000001u) { - set_has_name(); - name_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.name_); - } - if (cached_has_bits & 0x00000002u) { - set_has_s(); - s_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.s_); - } - if (cached_has_bits & 0x00000004u) { - type_ = from.type_; - } - if (cached_has_bits & 0x00000008u) { - i_ = from.i_; - } - if (cached_has_bits & 0x00000010u) { - f_ = from.f_; - } - if (cached_has_bits & 0x00000020u) { - b_ = from.b_; - } - if (cached_has_bits & 0x00000040u) { - l_ = from.l_; - } - if (cached_has_bits & 0x00000080u) { - block_idx_ = from.block_idx_; - } - _has_bits_[0] |= cached_has_bits; + // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.OpDesc.Attr) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + ints_.MergeFrom(from.ints_); + floats_.MergeFrom(from.floats_); + strings_.MergeFrom(from.strings_); + bools_.MergeFrom(from.bools_); + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 255u) { + if (cached_has_bits & 0x00000001u) { + set_has_name(); + name_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.name_); + } + if (cached_has_bits & 0x00000002u) { + set_has_s(); + s_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.s_); + } + if (cached_has_bits & 0x00000004u) { + type_ = from.type_; + } + if (cached_has_bits & 0x00000008u) { + i_ = from.i_; } + if (cached_has_bits & 0x00000010u) { + f_ = from.f_; + } + if (cached_has_bits & 0x00000020u) { + b_ = from.b_; + } + if (cached_has_bits & 0x00000040u) { + l_ = from.l_; + } + if (cached_has_bits & 0x00000080u) { + block_idx_ = from.block_idx_; + } + _has_bits_[0] |= cached_has_bits; + } } void OpDesc_Attr::CopyFrom(const OpDesc_Attr &from) { - // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.OpDesc.Attr) - if (&from == this) - return; - Clear(); - MergeFrom(from); + // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.OpDesc.Attr) + if (&from == this) + return; + Clear(); + MergeFrom(from); } bool OpDesc_Attr::IsInitialized() const { - if ((_has_bits_[0] & 0x00000005) != 0x00000005) - return false; - return true; + if ((_has_bits_[0] & 0x00000005) != 0x00000005) + return false; + return true; } void OpDesc_Attr::Swap(OpDesc_Attr *other) { - if (other == this) - return; - InternalSwap(other); + if (other == this) + return; + InternalSwap(other); } void OpDesc_Attr::InternalSwap(OpDesc_Attr *other) { - using std::swap; - ints_.InternalSwap(&other->ints_); - floats_.InternalSwap(&other->floats_); - strings_.InternalSwap(&other->strings_); - bools_.InternalSwap(&other->bools_); - name_.Swap(&other->name_); - s_.Swap(&other->s_); - swap(type_, other->type_); - swap(i_, other->i_); - swap(f_, other->f_); - swap(b_, other->b_); - swap(l_, other->l_); - swap(block_idx_, other->block_idx_); - swap(_has_bits_[0], other->_has_bits_[0]); - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); + using std::swap; + ints_.InternalSwap(&other->ints_); + floats_.InternalSwap(&other->floats_); + strings_.InternalSwap(&other->strings_); + bools_.InternalSwap(&other->bools_); + name_.Swap(&other->name_); + s_.Swap(&other->s_); + swap(type_, other->type_); + swap(i_, other->i_); + swap(f_, other->f_); + swap(b_, other->b_); + swap(l_, other->l_); + swap(block_idx_, other->block_idx_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); } ::std::string OpDesc_Attr::GetTypeName() const { - return "paddle_mobile.framework.proto.OpDesc.Attr"; + return "paddle_mobile.framework.proto.OpDesc.Attr"; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -983,91 +959,88 @@ void OpDesc_Attr::InternalSwap(OpDesc_Attr *other) { // required string name = 1; bool OpDesc_Attr::has_name() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } void OpDesc_Attr::set_has_name() { _has_bits_[0] |= 0x00000001u; } void OpDesc_Attr::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } void OpDesc_Attr::clear_name() { - name_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_name(); + name_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); } const ::std::string &OpDesc_Attr::name() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.name) - return name_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.name) + return name_.GetNoArena(); } void OpDesc_Attr::set_name(const ::std::string &value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.name) } #if LANG_CXX11 void OpDesc_Attr::set_name(::std::string &&value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpDesc.Attr.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpDesc.Attr.name) } #endif void OpDesc_Attr::set_name(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Attr.name) + GOOGLE_DCHECK(value != NULL); + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Attr.name) } void OpDesc_Attr::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:paddle_mobile.framework.proto.OpDesc.Attr.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Attr.name) } ::std::string *OpDesc_Attr::mutable_name() { - set_has_name(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Attr.name) - return name_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_name(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Attr.name) + return name_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string *OpDesc_Attr::release_name() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpDesc.Attr.name) - clear_has_name(); - return name_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpDesc.Attr.name) + clear_has_name(); + return name_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void OpDesc_Attr::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:paddle_mobile.framework.proto.OpDesc.Attr.name) + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpDesc.Attr.name) } // required .paddle_mobile.framework.proto.AttrType type = 2; bool OpDesc_Attr::has_type() const { - return (_has_bits_[0] & 0x00000004u) != 0; + return (_has_bits_[0] & 0x00000004u) != 0; } void OpDesc_Attr::set_has_type() { _has_bits_[0] |= 0x00000004u; } void OpDesc_Attr::clear_has_type() { _has_bits_[0] &= ~0x00000004u; } void OpDesc_Attr::clear_type() { - type_ = 0; - clear_has_type(); + type_ = 0; + clear_has_type(); } ::paddle_mobile::framework::proto::AttrType OpDesc_Attr::type() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.type) - return static_cast<::paddle_mobile::framework::proto::AttrType>(type_); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.type) + return static_cast<::paddle_mobile::framework::proto::AttrType>(type_); } void OpDesc_Attr::set_type(::paddle_mobile::framework::proto::AttrType value) { - assert(::paddle_mobile::framework::proto::AttrType_IsValid(value)); - set_has_type(); - type_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.type) + assert(::paddle_mobile::framework::proto::AttrType_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.type) } // optional int32 i = 3; @@ -1075,17 +1048,17 @@ bool OpDesc_Attr::has_i() const { return (_has_bits_[0] & 0x00000008u) != 0; } void OpDesc_Attr::set_has_i() { _has_bits_[0] |= 0x00000008u; } void OpDesc_Attr::clear_has_i() { _has_bits_[0] &= ~0x00000008u; } void OpDesc_Attr::clear_i() { - i_ = 0; - clear_has_i(); + i_ = 0; + clear_has_i(); } ::google::protobuf::int32 OpDesc_Attr::i() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.i) - return i_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.i) + return i_; } void OpDesc_Attr::set_i(::google::protobuf::int32 value) { - set_has_i(); - i_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.i) + set_has_i(); + i_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.i) } // optional float f = 4; @@ -1093,17 +1066,17 @@ bool OpDesc_Attr::has_f() const { return (_has_bits_[0] & 0x00000010u) != 0; } void OpDesc_Attr::set_has_f() { _has_bits_[0] |= 0x00000010u; } void OpDesc_Attr::clear_has_f() { _has_bits_[0] &= ~0x00000010u; } void OpDesc_Attr::clear_f() { - f_ = 0; - clear_has_f(); + f_ = 0; + clear_has_f(); } float OpDesc_Attr::f() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.f) - return f_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.f) + return f_; } void OpDesc_Attr::set_f(float value) { - set_has_f(); - f_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.f) + set_has_f(); + f_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.f) } // optional string s = 5; @@ -1111,177 +1084,176 @@ bool OpDesc_Attr::has_s() const { return (_has_bits_[0] & 0x00000002u) != 0; } void OpDesc_Attr::set_has_s() { _has_bits_[0] |= 0x00000002u; } void OpDesc_Attr::clear_has_s() { _has_bits_[0] &= ~0x00000002u; } void OpDesc_Attr::clear_s() { - s_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_s(); + s_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_s(); } const ::std::string &OpDesc_Attr::s() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.s) - return s_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.s) + return s_.GetNoArena(); } void OpDesc_Attr::set_s(const ::std::string &value) { - set_has_s(); - s_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.s) + set_has_s(); + s_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.s) } #if LANG_CXX11 void OpDesc_Attr::set_s(::std::string &&value) { - set_has_s(); - s_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpDesc.Attr.s) + set_has_s(); + s_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpDesc.Attr.s) } #endif void OpDesc_Attr::set_s(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_s(); - s_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Attr.s) + GOOGLE_DCHECK(value != NULL); + set_has_s(); + s_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Attr.s) } void OpDesc_Attr::set_s(const char *value, size_t size) { - set_has_s(); - s_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Attr.s) + set_has_s(); + s_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Attr.s) } ::std::string *OpDesc_Attr::mutable_s() { - set_has_s(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Attr.s) - return s_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_s(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Attr.s) + return s_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string *OpDesc_Attr::release_s() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpDesc.Attr.s) - clear_has_s(); - return s_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpDesc.Attr.s) + clear_has_s(); + return s_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void OpDesc_Attr::set_allocated_s(::std::string *s) { - if (s != NULL) { - set_has_s(); - } else { - clear_has_s(); - } - s_.SetAllocatedNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), s); - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpDesc.Attr.s) + if (s != NULL) { + set_has_s(); + } else { + clear_has_s(); + } + s_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), s); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpDesc.Attr.s) } // repeated int32 ints = 6; int OpDesc_Attr::ints_size() const { return ints_.size(); } void OpDesc_Attr::clear_ints() { ints_.Clear(); } ::google::protobuf::int32 OpDesc_Attr::ints(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.ints) - return ints_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.ints) + return ints_.Get(index); } void OpDesc_Attr::set_ints(int index, ::google::protobuf::int32 value) { - ints_.Set(index, value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.ints) + ints_.Set(index, value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.ints) } void OpDesc_Attr::add_ints(::google::protobuf::int32 value) { - ints_.Add(value); - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.ints) + ints_.Add(value); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.ints) } const ::google::protobuf::RepeatedField<::google::protobuf::int32> & OpDesc_Attr::ints() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.ints) - return ints_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.ints) + return ints_; } ::google::protobuf::RepeatedField<::google::protobuf::int32> * OpDesc_Attr::mutable_ints() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.ints) - return &ints_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.ints) + return &ints_; } // repeated float floats = 7; int OpDesc_Attr::floats_size() const { return floats_.size(); } void OpDesc_Attr::clear_floats() { floats_.Clear(); } float OpDesc_Attr::floats(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.floats) - return floats_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.floats) + return floats_.Get(index); } void OpDesc_Attr::set_floats(int index, float value) { - floats_.Set(index, value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.floats) + floats_.Set(index, value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.floats) } void OpDesc_Attr::add_floats(float value) { - floats_.Add(value); - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.floats) + floats_.Add(value); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.floats) } const ::google::protobuf::RepeatedField &OpDesc_Attr::floats() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.floats) - return floats_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.floats) + return floats_; } ::google::protobuf::RepeatedField *OpDesc_Attr::mutable_floats() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.floats) - return &floats_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.floats) + return &floats_; } // repeated string strings = 8; int OpDesc_Attr::strings_size() const { return strings_.size(); } void OpDesc_Attr::clear_strings() { strings_.Clear(); } const ::std::string &OpDesc_Attr::strings(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.strings) - return strings_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.strings) + return strings_.Get(index); } ::std::string *OpDesc_Attr::mutable_strings(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Attr.strings) - return strings_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Attr.strings) + return strings_.Mutable(index); } void OpDesc_Attr::set_strings(int index, const ::std::string &value) { - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.strings) - strings_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.strings) + strings_.Mutable(index)->assign(value); } #if LANG_CXX11 void OpDesc_Attr::set_strings(int index, ::std::string &&value) { - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.strings) - strings_.Mutable(index)->assign(std::move(value)); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.strings) + strings_.Mutable(index)->assign(std::move(value)); } #endif void OpDesc_Attr::set_strings(int index, const char *value) { - GOOGLE_DCHECK(value != NULL); - strings_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Attr.strings) + GOOGLE_DCHECK(value != NULL); + strings_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Attr.strings) } void OpDesc_Attr::set_strings(int index, const char *value, size_t size) { - strings_.Mutable(index)->assign(reinterpret_cast(value), - size); - // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Attr.strings) + strings_.Mutable(index)->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Attr.strings) } ::std::string *OpDesc_Attr::add_strings() { - // @@protoc_insertion_point(field_add_mutable:paddle_mobile.framework.proto.OpDesc.Attr.strings) - return strings_.Add(); + // @@protoc_insertion_point(field_add_mutable:paddle_mobile.framework.proto.OpDesc.Attr.strings) + return strings_.Add(); } void OpDesc_Attr::add_strings(const ::std::string &value) { - strings_.Add()->assign(value); - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.strings) + strings_.Add()->assign(value); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.strings) } #if LANG_CXX11 void OpDesc_Attr::add_strings(::std::string &&value) { - strings_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.strings) + strings_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.strings) } #endif void OpDesc_Attr::add_strings(const char *value) { - GOOGLE_DCHECK(value != NULL); - strings_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:paddle_mobile.framework.proto.OpDesc.Attr.strings) + GOOGLE_DCHECK(value != NULL); + strings_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:paddle_mobile.framework.proto.OpDesc.Attr.strings) } void OpDesc_Attr::add_strings(const char *value, size_t size) { - strings_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:paddle_mobile.framework.proto.OpDesc.Attr.strings) + strings_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:paddle_mobile.framework.proto.OpDesc.Attr.strings) } const ::google::protobuf::RepeatedPtrField<::std::string> & OpDesc_Attr::strings() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.strings) - return strings_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.strings) + return strings_; } ::google::protobuf::RepeatedPtrField<::std::string> * OpDesc_Attr::mutable_strings() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.strings) - return &strings_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.strings) + return &strings_; } // optional bool b = 10; @@ -1289,61 +1261,61 @@ bool OpDesc_Attr::has_b() const { return (_has_bits_[0] & 0x00000020u) != 0; } void OpDesc_Attr::set_has_b() { _has_bits_[0] |= 0x00000020u; } void OpDesc_Attr::clear_has_b() { _has_bits_[0] &= ~0x00000020u; } void OpDesc_Attr::clear_b() { - b_ = false; - clear_has_b(); + b_ = false; + clear_has_b(); } bool OpDesc_Attr::b() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.b) - return b_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.b) + return b_; } void OpDesc_Attr::set_b(bool value) { - set_has_b(); - b_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.b) + set_has_b(); + b_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.b) } // repeated bool bools = 11; int OpDesc_Attr::bools_size() const { return bools_.size(); } void OpDesc_Attr::clear_bools() { bools_.Clear(); } bool OpDesc_Attr::bools(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.bools) - return bools_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.bools) + return bools_.Get(index); } void OpDesc_Attr::set_bools(int index, bool value) { - bools_.Set(index, value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.bools) + bools_.Set(index, value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.bools) } void OpDesc_Attr::add_bools(bool value) { - bools_.Add(value); - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.bools) + bools_.Add(value); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.bools) } const ::google::protobuf::RepeatedField &OpDesc_Attr::bools() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.bools) - return bools_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.bools) + return bools_; } ::google::protobuf::RepeatedField *OpDesc_Attr::mutable_bools() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.bools) - return &bools_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.bools) + return &bools_; } // optional int32 block_idx = 12; bool OpDesc_Attr::has_block_idx() const { - return (_has_bits_[0] & 0x00000080u) != 0; + return (_has_bits_[0] & 0x00000080u) != 0; } void OpDesc_Attr::set_has_block_idx() { _has_bits_[0] |= 0x00000080u; } void OpDesc_Attr::clear_has_block_idx() { _has_bits_[0] &= ~0x00000080u; } void OpDesc_Attr::clear_block_idx() { - block_idx_ = 0; - clear_has_block_idx(); + block_idx_ = 0; + clear_has_block_idx(); } ::google::protobuf::int32 OpDesc_Attr::block_idx() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.block_idx) - return block_idx_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.block_idx) + return block_idx_; } void OpDesc_Attr::set_block_idx(::google::protobuf::int32 value) { - set_has_block_idx(); - block_idx_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.block_idx) + set_has_block_idx(); + block_idx_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.block_idx) } // optional int64 l = 13; @@ -1351,22 +1323,22 @@ bool OpDesc_Attr::has_l() const { return (_has_bits_[0] & 0x00000040u) != 0; } void OpDesc_Attr::set_has_l() { _has_bits_[0] |= 0x00000040u; } void OpDesc_Attr::clear_has_l() { _has_bits_[0] &= ~0x00000040u; } void OpDesc_Attr::clear_l() { - l_ = GOOGLE_LONGLONG(0); - clear_has_l(); + l_ = GOOGLE_LONGLONG(0); + clear_has_l(); } ::google::protobuf::int64 OpDesc_Attr::l() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.l) - return l_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.l) + return l_; } void OpDesc_Attr::set_l(::google::protobuf::int64 value) { - set_has_l(); - l_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.l) + set_has_l(); + l_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.l) } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS - // =================================================================== + // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int OpDesc_Var::kParameterFieldNumber; @@ -1375,246 +1347,245 @@ const int OpDesc_Var::kArgumentsFieldNumber; OpDesc_Var::OpDesc_Var() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_framework_2eproto::InitDefaults(); - } - SharedCtor(); - // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.OpDesc.Var) + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + protobuf_framework_2eproto::InitDefaults(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.OpDesc.Var) } OpDesc_Var::OpDesc_Var(const OpDesc_Var &from) : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0), arguments_(from.arguments_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - parameter_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.has_parameter()) { - parameter_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.parameter_); - } - // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.OpDesc.Var) + _internal_metadata_.MergeFrom(from._internal_metadata_); + parameter_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_parameter()) { + parameter_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.parameter_); + } + // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.OpDesc.Var) } void OpDesc_Var::SharedCtor() { - _cached_size_ = 0; - parameter_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _cached_size_ = 0; + parameter_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } OpDesc_Var::~OpDesc_Var() { - // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.OpDesc.Var) - SharedDtor(); + // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.OpDesc.Var) + SharedDtor(); } void OpDesc_Var::SharedDtor() { - parameter_.DestroyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + parameter_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void OpDesc_Var::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const OpDesc_Var &OpDesc_Var::default_instance() { - protobuf_framework_2eproto::InitDefaults(); - return *internal_default_instance(); + protobuf_framework_2eproto::InitDefaults(); + return *internal_default_instance(); } OpDesc_Var *OpDesc_Var::New(::google::protobuf::Arena *arena) const { - OpDesc_Var *n = new OpDesc_Var; - if (arena != NULL) { - arena->Own(n); - } - return n; + OpDesc_Var *n = new OpDesc_Var; + if (arena != NULL) { + arena->Own(n); + } + return n; } void OpDesc_Var::Clear() { - // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.OpDesc.Var) - ::google::protobuf::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void)cached_has_bits; + // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.OpDesc.Var) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; - arguments_.Clear(); - if (has_parameter()) { - GOOGLE_DCHECK(!parameter_.IsDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*parameter_.UnsafeRawStringPointer())->clear(); - } - _has_bits_.Clear(); - _internal_metadata_.Clear(); + arguments_.Clear(); + if (has_parameter()) { + GOOGLE_DCHECK(!parameter_.IsDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited())); + (*parameter_.UnsafeRawStringPointer())->clear(); + } + _has_bits_.Clear(); + _internal_metadata_.Clear(); } bool OpDesc_Var::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::NewPermanentCallback( - &_internal_metadata_, - &::google::protobuf::internal::InternalMetadataWithArenaLite:: - mutable_unknown_fields)); - ::google::protobuf::io::CodedOutputStream unknown_fields_stream( - &unknown_fields_string, false); - // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.OpDesc.Var) - for (;;) { - ::std::pair<::google::protobuf::uint32, bool> p = - input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) - goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber( - tag)) { - // required string parameter = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_parameter())); - } else { - goto handle_unusual; - } - break; - } - - // repeated string arguments = 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->add_arguments())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } - } + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ + goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::NewPermanentCallback( + &_internal_metadata_, + &::google::protobuf::internal::InternalMetadataWithArenaLite:: + mutable_unknown_fields)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.OpDesc.Var) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = + input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) + goto handle_unusual; + switch ( + ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required string parameter = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_parameter())); + } else { + goto handle_unusual; + } + break; } + + // repeated string arguments = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_arguments())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } success: - // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.OpDesc.Var) - return true; + // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.OpDesc.Var) + return true; failure: - // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.OpDesc.Var) - return false; + // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.OpDesc.Var) + return false; #undef DO_ } void OpDesc_Var::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream *output) const { - // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.OpDesc.Var) - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; + // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.OpDesc.Var) + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; - cached_has_bits = _has_bits_[0]; - // required string parameter = 1; - if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->parameter(), output); - } + cached_has_bits = _has_bits_[0]; + // required string parameter = 1; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->parameter(), output); + } - // repeated string arguments = 2; - for (int i = 0, n = this->arguments_size(); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteString( - 2, this->arguments(i), output); - } + // repeated string arguments = 2; + for (int i = 0, n = this->arguments_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteString( + 2, this->arguments(i), output); + } - output->WriteRaw( - _internal_metadata_.unknown_fields().data(), - static_cast(_internal_metadata_.unknown_fields().size())); - // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.OpDesc.Var) + output->WriteRaw( + _internal_metadata_.unknown_fields().data(), + static_cast(_internal_metadata_.unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.OpDesc.Var) } size_t OpDesc_Var::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.OpDesc.Var) - size_t total_size = 0; - - total_size += _internal_metadata_.unknown_fields().size(); - - // required string parameter = 1; - if (has_parameter()) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->parameter()); - } - // repeated string arguments = 2; - total_size += - 1 * ::google::protobuf::internal::FromIntSize(this->arguments_size()); - for (int i = 0, n = this->arguments_size(); i < n; i++) { - total_size += ::google::protobuf::internal::WireFormatLite::StringSize( - this->arguments(i)); - } - - int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; + // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.OpDesc.Var) + size_t total_size = 0; + + total_size += _internal_metadata_.unknown_fields().size(); + + // required string parameter = 1; + if (has_parameter()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->parameter()); + } + // repeated string arguments = 2; + total_size += + 1 * ::google::protobuf::internal::FromIntSize(this->arguments_size()); + for (int i = 0, n = this->arguments_size(); i < n; i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->arguments(i)); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; } void OpDesc_Var::CheckTypeAndMergeFrom( const ::google::protobuf::MessageLite &from) { - MergeFrom(*::google::protobuf::down_cast(&from)); + MergeFrom(*::google::protobuf::down_cast(&from)); } void OpDesc_Var::MergeFrom(const OpDesc_Var &from) { - // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.OpDesc.Var) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - arguments_.MergeFrom(from.arguments_); - if (from.has_parameter()) { - set_has_parameter(); - parameter_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.parameter_); - } + // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.OpDesc.Var) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + arguments_.MergeFrom(from.arguments_); + if (from.has_parameter()) { + set_has_parameter(); + parameter_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.parameter_); + } } void OpDesc_Var::CopyFrom(const OpDesc_Var &from) { - // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.OpDesc.Var) - if (&from == this) - return; - Clear(); - MergeFrom(from); + // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.OpDesc.Var) + if (&from == this) + return; + Clear(); + MergeFrom(from); } bool OpDesc_Var::IsInitialized() const { - if ((_has_bits_[0] & 0x00000001) != 0x00000001) - return false; - return true; + if ((_has_bits_[0] & 0x00000001) != 0x00000001) + return false; + return true; } void OpDesc_Var::Swap(OpDesc_Var *other) { - if (other == this) - return; - InternalSwap(other); + if (other == this) + return; + InternalSwap(other); } void OpDesc_Var::InternalSwap(OpDesc_Var *other) { - using std::swap; - arguments_.InternalSwap(&other->arguments_); - parameter_.Swap(&other->parameter_); - swap(_has_bits_[0], other->_has_bits_[0]); - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); + using std::swap; + arguments_.InternalSwap(&other->arguments_); + parameter_.Swap(&other->parameter_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); } ::std::string OpDesc_Var::GetTypeName() const { - return "paddle_mobile.framework.proto.OpDesc.Var"; + return "paddle_mobile.framework.proto.OpDesc.Var"; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -1622,141 +1593,140 @@ void OpDesc_Var::InternalSwap(OpDesc_Var *other) { // required string parameter = 1; bool OpDesc_Var::has_parameter() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } void OpDesc_Var::set_has_parameter() { _has_bits_[0] |= 0x00000001u; } void OpDesc_Var::clear_has_parameter() { _has_bits_[0] &= ~0x00000001u; } void OpDesc_Var::clear_parameter() { - parameter_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_parameter(); + parameter_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_parameter(); } const ::std::string &OpDesc_Var::parameter() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Var.parameter) - return parameter_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Var.parameter) + return parameter_.GetNoArena(); } void OpDesc_Var::set_parameter(const ::std::string &value) { - set_has_parameter(); - parameter_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Var.parameter) + set_has_parameter(); + parameter_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Var.parameter) } #if LANG_CXX11 void OpDesc_Var::set_parameter(::std::string &&value) { - set_has_parameter(); - parameter_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpDesc.Var.parameter) + set_has_parameter(); + parameter_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpDesc.Var.parameter) } #endif void OpDesc_Var::set_parameter(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_parameter(); - parameter_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Var.parameter) + GOOGLE_DCHECK(value != NULL); + set_has_parameter(); + parameter_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Var.parameter) } void OpDesc_Var::set_parameter(const char *value, size_t size) { - set_has_parameter(); - parameter_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Var.parameter) + set_has_parameter(); + parameter_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Var.parameter) } ::std::string *OpDesc_Var::mutable_parameter() { - set_has_parameter(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Var.parameter) - return parameter_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_parameter(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Var.parameter) + return parameter_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string *OpDesc_Var::release_parameter() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpDesc.Var.parameter) - clear_has_parameter(); - return parameter_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpDesc.Var.parameter) + clear_has_parameter(); + return parameter_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void OpDesc_Var::set_allocated_parameter(::std::string *parameter) { - if (parameter != NULL) { - set_has_parameter(); - } else { - clear_has_parameter(); - } - parameter_.SetAllocatedNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - parameter); - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpDesc.Var.parameter) + if (parameter != NULL) { + set_has_parameter(); + } else { + clear_has_parameter(); + } + parameter_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), parameter); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpDesc.Var.parameter) } // repeated string arguments = 2; int OpDesc_Var::arguments_size() const { return arguments_.size(); } void OpDesc_Var::clear_arguments() { arguments_.Clear(); } const ::std::string &OpDesc_Var::arguments(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Var.arguments) - return arguments_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Var.arguments) + return arguments_.Get(index); } ::std::string *OpDesc_Var::mutable_arguments(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Var.arguments) - return arguments_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Var.arguments) + return arguments_.Mutable(index); } void OpDesc_Var::set_arguments(int index, const ::std::string &value) { - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Var.arguments) - arguments_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Var.arguments) + arguments_.Mutable(index)->assign(value); } #if LANG_CXX11 void OpDesc_Var::set_arguments(int index, ::std::string &&value) { - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Var.arguments) - arguments_.Mutable(index)->assign(std::move(value)); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Var.arguments) + arguments_.Mutable(index)->assign(std::move(value)); } #endif void OpDesc_Var::set_arguments(int index, const char *value) { - GOOGLE_DCHECK(value != NULL); - arguments_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Var.arguments) + GOOGLE_DCHECK(value != NULL); + arguments_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Var.arguments) } void OpDesc_Var::set_arguments(int index, const char *value, size_t size) { - arguments_.Mutable(index)->assign(reinterpret_cast(value), - size); - // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Var.arguments) + arguments_.Mutable(index)->assign(reinterpret_cast(value), + size); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Var.arguments) } ::std::string *OpDesc_Var::add_arguments() { - // @@protoc_insertion_point(field_add_mutable:paddle_mobile.framework.proto.OpDesc.Var.arguments) - return arguments_.Add(); + // @@protoc_insertion_point(field_add_mutable:paddle_mobile.framework.proto.OpDesc.Var.arguments) + return arguments_.Add(); } void OpDesc_Var::add_arguments(const ::std::string &value) { - arguments_.Add()->assign(value); - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Var.arguments) + arguments_.Add()->assign(value); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Var.arguments) } #if LANG_CXX11 void OpDesc_Var::add_arguments(::std::string &&value) { - arguments_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Var.arguments) + arguments_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Var.arguments) } #endif void OpDesc_Var::add_arguments(const char *value) { - GOOGLE_DCHECK(value != NULL); - arguments_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:paddle_mobile.framework.proto.OpDesc.Var.arguments) + GOOGLE_DCHECK(value != NULL); + arguments_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:paddle_mobile.framework.proto.OpDesc.Var.arguments) } void OpDesc_Var::add_arguments(const char *value, size_t size) { - arguments_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:paddle_mobile.framework.proto.OpDesc.Var.arguments) + arguments_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:paddle_mobile.framework.proto.OpDesc.Var.arguments) } const ::google::protobuf::RepeatedPtrField<::std::string> & OpDesc_Var::arguments() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Var.arguments) - return arguments_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Var.arguments) + return arguments_; } ::google::protobuf::RepeatedPtrField<::std::string> * OpDesc_Var::mutable_arguments() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Var.arguments) - return &arguments_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Var.arguments) + return &arguments_; } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS - // =================================================================== + // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int OpDesc::kTypeFieldNumber; @@ -1768,366 +1738,366 @@ const int OpDesc::kIsTargetFieldNumber; OpDesc::OpDesc() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_framework_2eproto::InitDefaults(); - } - SharedCtor(); - // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.OpDesc) + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + protobuf_framework_2eproto::InitDefaults(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.OpDesc) } OpDesc::OpDesc(const OpDesc &from) : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0), inputs_(from.inputs_), outputs_(from.outputs_), attrs_(from.attrs_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - type_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.has_type()) { - type_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.type_); - } - is_target_ = from.is_target_; - // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.OpDesc) + _internal_metadata_.MergeFrom(from._internal_metadata_); + type_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_type()) { + type_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.type_); + } + is_target_ = from.is_target_; + // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.OpDesc) } void OpDesc::SharedCtor() { - _cached_size_ = 0; - type_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - is_target_ = false; + _cached_size_ = 0; + type_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + is_target_ = false; } OpDesc::~OpDesc() { - // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.OpDesc) - SharedDtor(); + // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.OpDesc) + SharedDtor(); } void OpDesc::SharedDtor() { - type_.DestroyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void OpDesc::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const OpDesc &OpDesc::default_instance() { - protobuf_framework_2eproto::InitDefaults(); - return *internal_default_instance(); + protobuf_framework_2eproto::InitDefaults(); + return *internal_default_instance(); } OpDesc *OpDesc::New(::google::protobuf::Arena *arena) const { - OpDesc *n = new OpDesc; - if (arena != NULL) { - arena->Own(n); - } - return n; + OpDesc *n = new OpDesc; + if (arena != NULL) { + arena->Own(n); + } + return n; } void OpDesc::Clear() { - // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.OpDesc) - ::google::protobuf::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void)cached_has_bits; - - inputs_.Clear(); - outputs_.Clear(); - attrs_.Clear(); - if (has_type()) { - GOOGLE_DCHECK(!type_.IsDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*type_.UnsafeRawStringPointer())->clear(); - } - is_target_ = false; - _has_bits_.Clear(); - _internal_metadata_.Clear(); + // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.OpDesc) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + inputs_.Clear(); + outputs_.Clear(); + attrs_.Clear(); + if (has_type()) { + GOOGLE_DCHECK(!type_.IsDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited())); + (*type_.UnsafeRawStringPointer())->clear(); + } + is_target_ = false; + _has_bits_.Clear(); + _internal_metadata_.Clear(); } bool OpDesc::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::NewPermanentCallback( - &_internal_metadata_, - &::google::protobuf::internal::InternalMetadataWithArenaLite:: - mutable_unknown_fields)); - ::google::protobuf::io::CodedOutputStream unknown_fields_stream( - &unknown_fields_string, false); - // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.OpDesc) - for (;;) { - ::std::pair<::google::protobuf::uint32, bool> p = - input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) - goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber( - tag)) { - // repeated .paddle_mobile.framework.proto.OpDesc.Var inputs - // = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite:: - ReadMessageNoVirtual(input, add_inputs())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .paddle_mobile.framework.proto.OpDesc.Var - // outputs = 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite:: - ReadMessageNoVirtual(input, add_outputs())); - } else { - goto handle_unusual; - } - break; - } - - // required string type = 3; - case 3: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_type())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .paddle_mobile.framework.proto.OpDesc.Attr attrs - // = 4; - case 4: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite:: - ReadMessageNoVirtual(input, add_attrs())); - } else { - goto handle_unusual; - } - break; - } - - // optional bool is_target = 5 [default = false]; - case 5: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { - set_has_is_target(); - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - bool, ::google::protobuf::internal::WireFormatLite:: - TYPE_BOOL>(input, &is_target_))); - } else { - goto handle_unusual; - } - break; - } + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ + goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::NewPermanentCallback( + &_internal_metadata_, + &::google::protobuf::internal::InternalMetadataWithArenaLite:: + mutable_unknown_fields)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.OpDesc) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = + input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) + goto handle_unusual; + switch ( + ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .paddle_mobile.framework.proto.OpDesc.Var inputs + // = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_inputs())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .paddle_mobile.framework.proto.OpDesc.Var + // outputs = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_outputs())); + } else { + goto handle_unusual; + } + break; + } - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } - } + // required string type = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_type())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .paddle_mobile.framework.proto.OpDesc.Attr attrs + // = 4; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_attrs())); + } else { + goto handle_unusual; + } + break; } + + // optional bool is_target = 5 [default = false]; + case 5: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + set_has_is_target(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_target_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } success: - // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.OpDesc) - return true; + // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.OpDesc) + return true; failure: - // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.OpDesc) - return false; + // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.OpDesc) + return false; #undef DO_ } void OpDesc::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream *output) const { - // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.OpDesc) - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; + // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.OpDesc) + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + // repeated .paddle_mobile.framework.proto.OpDesc.Var inputs = + // 1; + for (unsigned int i = 0, n = static_cast(this->inputs_size()); + i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, this->inputs(static_cast(i)), output); + } + + // repeated .paddle_mobile.framework.proto.OpDesc.Var outputs = + // 2; + for (unsigned int i = 0, n = static_cast(this->outputs_size()); + i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->outputs(static_cast(i)), output); + } + + cached_has_bits = _has_bits_[0]; + // required string type = 3; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->type(), output); + } + + // repeated .paddle_mobile.framework.proto.OpDesc.Attr attrs = + // 4; + for (unsigned int i = 0, n = static_cast(this->attrs_size()); + i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 4, this->attrs(static_cast(i)), output); + } + + // optional bool is_target = 5 [default = false]; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormatLite::WriteBool( + 5, this->is_target(), output); + } + + output->WriteRaw( + _internal_metadata_.unknown_fields().data(), + static_cast(_internal_metadata_.unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.OpDesc) +} - // repeated .paddle_mobile.framework.proto.OpDesc.Var inputs = - // 1; - for (unsigned int i = 0, n = static_cast(this->inputs_size()); - i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 1, this->inputs(static_cast(i)), output); - } +size_t OpDesc::ByteSizeLong() const { + // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.OpDesc) + size_t total_size = 0; + + total_size += _internal_metadata_.unknown_fields().size(); + + // required string type = 3; + if (has_type()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->type()); + } + // repeated .paddle_mobile.framework.proto.OpDesc.Var inputs = + // 1; + { + unsigned int count = static_cast(this->inputs_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->inputs(static_cast(i))); + } + } + + // repeated .paddle_mobile.framework.proto.OpDesc.Var outputs = + // 2; + { + unsigned int count = static_cast(this->outputs_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->outputs(static_cast(i))); + } + } + + // repeated .paddle_mobile.framework.proto.OpDesc.Attr attrs = + // 4; + { + unsigned int count = static_cast(this->attrs_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->attrs(static_cast(i))); + } + } + + // optional bool is_target = 5 [default = false]; + if (has_is_target()) { + total_size += 1 + 1; + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} - // repeated .paddle_mobile.framework.proto.OpDesc.Var outputs = - // 2; - for (unsigned int i = 0, - n = static_cast(this->outputs_size()); - i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 2, this->outputs(static_cast(i)), output); - } +void OpDesc::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite &from) { + MergeFrom(*::google::protobuf::down_cast(&from)); +} - cached_has_bits = _has_bits_[0]; - // required string type = 3; +void OpDesc::MergeFrom(const OpDesc &from) { + // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.OpDesc) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + inputs_.MergeFrom(from.inputs_); + outputs_.MergeFrom(from.outputs_); + attrs_.MergeFrom(from.attrs_); + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 3u) { if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 3, this->type(), output); + set_has_type(); + type_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.type_); } - - // repeated .paddle_mobile.framework.proto.OpDesc.Attr attrs = - // 4; - for (unsigned int i = 0, n = static_cast(this->attrs_size()); - i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 4, this->attrs(static_cast(i)), output); - } - - // optional bool is_target = 5 [default = false]; if (cached_has_bits & 0x00000002u) { - ::google::protobuf::internal::WireFormatLite::WriteBool( - 5, this->is_target(), output); - } - - output->WriteRaw( - _internal_metadata_.unknown_fields().data(), - static_cast(_internal_metadata_.unknown_fields().size())); - // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.OpDesc) -} - -size_t OpDesc::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.OpDesc) - size_t total_size = 0; - - total_size += _internal_metadata_.unknown_fields().size(); - - // required string type = 3; - if (has_type()) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->type()); - } - // repeated .paddle_mobile.framework.proto.OpDesc.Var inputs = - // 1; - { - unsigned int count = static_cast(this->inputs_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += ::google::protobuf::internal::WireFormatLite:: - MessageSizeNoVirtual(this->inputs(static_cast(i))); - } - } - - // repeated .paddle_mobile.framework.proto.OpDesc.Var outputs = - // 2; - { - unsigned int count = static_cast(this->outputs_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += ::google::protobuf::internal::WireFormatLite:: - MessageSizeNoVirtual(this->outputs(static_cast(i))); - } - } - - // repeated .paddle_mobile.framework.proto.OpDesc.Attr attrs = - // 4; - { - unsigned int count = static_cast(this->attrs_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += ::google::protobuf::internal::WireFormatLite:: - MessageSizeNoVirtual(this->attrs(static_cast(i))); - } - } - - // optional bool is_target = 5 [default = false]; - if (has_is_target()) { - total_size += 1 + 1; - } - - int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; -} - -void OpDesc::CheckTypeAndMergeFrom( - const ::google::protobuf::MessageLite &from) { - MergeFrom(*::google::protobuf::down_cast(&from)); -} - -void OpDesc::MergeFrom(const OpDesc &from) { - // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.OpDesc) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - inputs_.MergeFrom(from.inputs_); - outputs_.MergeFrom(from.outputs_); - attrs_.MergeFrom(from.attrs_); - cached_has_bits = from._has_bits_[0]; - if (cached_has_bits & 3u) { - if (cached_has_bits & 0x00000001u) { - set_has_type(); - type_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.type_); - } - if (cached_has_bits & 0x00000002u) { - is_target_ = from.is_target_; - } - _has_bits_[0] |= cached_has_bits; + is_target_ = from.is_target_; } + _has_bits_[0] |= cached_has_bits; + } } void OpDesc::CopyFrom(const OpDesc &from) { - // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.OpDesc) - if (&from == this) - return; - Clear(); - MergeFrom(from); + // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.OpDesc) + if (&from == this) + return; + Clear(); + MergeFrom(from); } bool OpDesc::IsInitialized() const { - if ((_has_bits_[0] & 0x00000001) != 0x00000001) - return false; - if (!::google::protobuf::internal::AllAreInitialized(this->inputs())) - return false; - if (!::google::protobuf::internal::AllAreInitialized(this->outputs())) - return false; - if (!::google::protobuf::internal::AllAreInitialized(this->attrs())) - return false; - return true; + if ((_has_bits_[0] & 0x00000001) != 0x00000001) + return false; + if (!::google::protobuf::internal::AllAreInitialized(this->inputs())) + return false; + if (!::google::protobuf::internal::AllAreInitialized(this->outputs())) + return false; + if (!::google::protobuf::internal::AllAreInitialized(this->attrs())) + return false; + return true; } void OpDesc::Swap(OpDesc *other) { - if (other == this) - return; - InternalSwap(other); + if (other == this) + return; + InternalSwap(other); } void OpDesc::InternalSwap(OpDesc *other) { - using std::swap; - inputs_.InternalSwap(&other->inputs_); - outputs_.InternalSwap(&other->outputs_); - attrs_.InternalSwap(&other->attrs_); - type_.Swap(&other->type_); - swap(is_target_, other->is_target_); - swap(_has_bits_[0], other->_has_bits_[0]); - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); + using std::swap; + inputs_.InternalSwap(&other->inputs_); + outputs_.InternalSwap(&other->outputs_); + attrs_.InternalSwap(&other->attrs_); + type_.Swap(&other->type_); + swap(is_target_, other->is_target_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); } ::std::string OpDesc::GetTypeName() const { - return "paddle_mobile.framework.proto.OpDesc"; + return "paddle_mobile.framework.proto.OpDesc"; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -2138,65 +2108,62 @@ bool OpDesc::has_type() const { return (_has_bits_[0] & 0x00000001u) != 0; } void OpDesc::set_has_type() { _has_bits_[0] |= 0x00000001u; } void OpDesc::clear_has_type() { _has_bits_[0] &= ~0x00000001u; } void OpDesc::clear_type() { - type_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_type(); + type_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_type(); } const ::std::string &OpDesc::type() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.type) - return type_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.type) + return type_.GetNoArena(); } void OpDesc::set_type(const ::std::string &value) { - set_has_type(); - type_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.type) + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.type) } #if LANG_CXX11 void OpDesc::set_type(::std::string &&value) { - set_has_type(); - type_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpDesc.type) + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpDesc.type) } #endif void OpDesc::set_type(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_type(); - type_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.type) + GOOGLE_DCHECK(value != NULL); + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.type) } void OpDesc::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:paddle_mobile.framework.proto.OpDesc.type) + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.type) } ::std::string *OpDesc::mutable_type() { - set_has_type(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.type) - return type_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_type(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.type) + return type_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string *OpDesc::release_type() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpDesc.type) - clear_has_type(); - return type_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpDesc.type) + clear_has_type(); + return type_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void OpDesc::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:paddle_mobile.framework.proto.OpDesc.type) + if (type != NULL) { + set_has_type(); + } else { + clear_has_type(); + } + type_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), type); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpDesc.type) } // repeated .paddle_mobile.framework.proto.OpDesc.Var inputs = 1; @@ -2204,29 +2171,29 @@ int OpDesc::inputs_size() const { return inputs_.size(); } void OpDesc::clear_inputs() { inputs_.Clear(); } const ::paddle_mobile::framework::proto::OpDesc_Var & OpDesc::inputs(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.inputs) - return inputs_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.inputs) + return inputs_.Get(index); } ::paddle_mobile::framework::proto::OpDesc_Var * OpDesc::mutable_inputs(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.inputs) - return inputs_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.inputs) + return inputs_.Mutable(index); } ::paddle_mobile::framework::proto::OpDesc_Var *OpDesc::add_inputs() { - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.inputs) - return inputs_.Add(); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.inputs) + return inputs_.Add(); } ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpDesc_Var> * OpDesc::mutable_inputs() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.inputs) - return &inputs_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.inputs) + return &inputs_; } const ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpDesc_Var> & OpDesc::inputs() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.inputs) - return inputs_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.inputs) + return inputs_; } // repeated .paddle_mobile.framework.proto.OpDesc.Var outputs = 2; @@ -2234,29 +2201,29 @@ int OpDesc::outputs_size() const { return outputs_.size(); } void OpDesc::clear_outputs() { outputs_.Clear(); } const ::paddle_mobile::framework::proto::OpDesc_Var & OpDesc::outputs(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.outputs) - return outputs_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.outputs) + return outputs_.Get(index); } ::paddle_mobile::framework::proto::OpDesc_Var * OpDesc::mutable_outputs(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.outputs) - return outputs_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.outputs) + return outputs_.Mutable(index); } ::paddle_mobile::framework::proto::OpDesc_Var *OpDesc::add_outputs() { - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.outputs) - return outputs_.Add(); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.outputs) + return outputs_.Add(); } ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpDesc_Var> * OpDesc::mutable_outputs() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.outputs) - return &outputs_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.outputs) + return &outputs_; } const ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpDesc_Var> & OpDesc::outputs() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.outputs) - return outputs_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.outputs) + return outputs_; } // repeated .paddle_mobile.framework.proto.OpDesc.Attr attrs = 4; @@ -2264,54 +2231,54 @@ int OpDesc::attrs_size() const { return attrs_.size(); } void OpDesc::clear_attrs() { attrs_.Clear(); } const ::paddle_mobile::framework::proto::OpDesc_Attr & OpDesc::attrs(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.attrs) - return attrs_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.attrs) + return attrs_.Get(index); } ::paddle_mobile::framework::proto::OpDesc_Attr * OpDesc::mutable_attrs(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.attrs) - return attrs_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.attrs) + return attrs_.Mutable(index); } ::paddle_mobile::framework::proto::OpDesc_Attr *OpDesc::add_attrs() { - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.attrs) - return attrs_.Add(); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.attrs) + return attrs_.Add(); } ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpDesc_Attr> * OpDesc::mutable_attrs() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.attrs) - return &attrs_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.attrs) + return &attrs_; } const ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpDesc_Attr> & OpDesc::attrs() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.attrs) - return attrs_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.attrs) + return attrs_; } // optional bool is_target = 5 [default = false]; bool OpDesc::has_is_target() const { - return (_has_bits_[0] & 0x00000002u) != 0; + return (_has_bits_[0] & 0x00000002u) != 0; } void OpDesc::set_has_is_target() { _has_bits_[0] |= 0x00000002u; } void OpDesc::clear_has_is_target() { _has_bits_[0] &= ~0x00000002u; } void OpDesc::clear_is_target() { - is_target_ = false; - clear_has_is_target(); + is_target_ = false; + clear_has_is_target(); } bool OpDesc::is_target() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.is_target) - return is_target_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.is_target) + return is_target_; } void OpDesc::set_is_target(bool value) { - set_has_is_target(); - is_target_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.is_target) + set_has_is_target(); + is_target_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.is_target) } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS - // =================================================================== + // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int OpProto_Var::kNameFieldNumber; @@ -2323,398 +2290,391 @@ const int OpProto_Var::kDispensableFieldNumber; OpProto_Var::OpProto_Var() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_framework_2eproto::InitDefaults(); - } - SharedCtor(); - // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.OpProto.Var) + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + protobuf_framework_2eproto::InitDefaults(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.OpProto.Var) } OpProto_Var::OpProto_Var(const OpProto_Var &from) : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - name_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.has_name()) { - name_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.name_); - } - comment_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.has_comment()) { - comment_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.comment_); - } - ::memcpy(&duplicable_, &from.duplicable_, - static_cast(reinterpret_cast(&dispensable_) - - reinterpret_cast(&duplicable_)) + - sizeof(dispensable_)); - // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.OpProto.Var) + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_name()) { + name_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.name_); + } + comment_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_comment()) { + comment_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.comment_); + } + ::memcpy(&duplicable_, &from.duplicable_, + static_cast(reinterpret_cast(&dispensable_) - + reinterpret_cast(&duplicable_)) + + sizeof(dispensable_)); + // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.OpProto.Var) } void OpProto_Var::SharedCtor() { - _cached_size_ = 0; - name_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - comment_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - ::memset(&duplicable_, 0, - static_cast(reinterpret_cast(&dispensable_) - - reinterpret_cast(&duplicable_)) + - sizeof(dispensable_)); + _cached_size_ = 0; + name_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + comment_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&duplicable_, 0, + static_cast(reinterpret_cast(&dispensable_) - + reinterpret_cast(&duplicable_)) + + sizeof(dispensable_)); } OpProto_Var::~OpProto_Var() { - // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.OpProto.Var) - SharedDtor(); + // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.OpProto.Var) + SharedDtor(); } void OpProto_Var::SharedDtor() { - name_.DestroyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - comment_.DestroyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + comment_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void OpProto_Var::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const OpProto_Var &OpProto_Var::default_instance() { - protobuf_framework_2eproto::InitDefaults(); - return *internal_default_instance(); + protobuf_framework_2eproto::InitDefaults(); + return *internal_default_instance(); } OpProto_Var *OpProto_Var::New(::google::protobuf::Arena *arena) const { - OpProto_Var *n = new OpProto_Var; - if (arena != NULL) { - arena->Own(n); - } - return n; + OpProto_Var *n = new OpProto_Var; + if (arena != NULL) { + arena->Own(n); + } + return n; } void OpProto_Var::Clear() { - // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.OpProto.Var) - ::google::protobuf::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void)cached_has_bits; - - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 3u) { - if (cached_has_bits & 0x00000001u) { - GOOGLE_DCHECK(!name_.IsDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*name_.UnsafeRawStringPointer())->clear(); - } - if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(!comment_.IsDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*comment_.UnsafeRawStringPointer())->clear(); - } + // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.OpProto.Var) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 3u) { + if (cached_has_bits & 0x00000001u) { + GOOGLE_DCHECK(!name_.IsDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited())); + (*name_.UnsafeRawStringPointer())->clear(); } - if (cached_has_bits & 28u) { - ::memset(&duplicable_, 0, - static_cast(reinterpret_cast(&dispensable_) - - reinterpret_cast(&duplicable_)) + - sizeof(dispensable_)); + if (cached_has_bits & 0x00000002u) { + GOOGLE_DCHECK(!comment_.IsDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited())); + (*comment_.UnsafeRawStringPointer())->clear(); } - _has_bits_.Clear(); - _internal_metadata_.Clear(); + } + if (cached_has_bits & 28u) { + ::memset(&duplicable_, 0, + static_cast(reinterpret_cast(&dispensable_) - + reinterpret_cast(&duplicable_)) + + sizeof(dispensable_)); + } + _has_bits_.Clear(); + _internal_metadata_.Clear(); } bool OpProto_Var::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::NewPermanentCallback( - &_internal_metadata_, - &::google::protobuf::internal::InternalMetadataWithArenaLite:: - mutable_unknown_fields)); - ::google::protobuf::io::CodedOutputStream unknown_fields_stream( - &unknown_fields_string, false); - // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.OpProto.Var) - for (;;) { - ::std::pair<::google::protobuf::uint32, bool> p = - input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) - goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber( - tag)) { - // required string name = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_name())); - } else { - goto handle_unusual; - } - break; - } - - // required string comment = 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_comment())); - } else { - goto handle_unusual; - } - break; - } - - // optional bool duplicable = 3 [default = false]; - case 3: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { - set_has_duplicable(); - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - bool, ::google::protobuf::internal::WireFormatLite:: - TYPE_BOOL>(input, &duplicable_))); - } else { - goto handle_unusual; - } - break; - } - - // optional bool intermediate = 4 [default = false]; - case 4: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { - set_has_intermediate(); - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - bool, ::google::protobuf::internal::WireFormatLite:: - TYPE_BOOL>(input, &intermediate_))); - } else { - goto handle_unusual; - } - break; - } - - // optional bool dispensable = 5 [default = false]; - case 5: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { - set_has_dispensable(); - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - bool, ::google::protobuf::internal::WireFormatLite:: - TYPE_BOOL>(input, &dispensable_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.OpProto.Var) - return true; -failure: - // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.OpProto.Var) - return false; -#undef DO_ -} - -void OpProto_Var::SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream *output) const { - // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.OpProto.Var) - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _has_bits_[0]; + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ + goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::NewPermanentCallback( + &_internal_metadata_, + &::google::protobuf::internal::InternalMetadataWithArenaLite:: + mutable_unknown_fields)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.OpProto.Var) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = + input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) + goto handle_unusual; + switch ( + ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required string name = 1; - if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->name(), output); + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + } else { + goto handle_unusual; + } + break; } // required string comment = 2; - if (cached_has_bits & 0x00000002u) { - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 2, this->comment(), output); + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_comment())); + } else { + goto handle_unusual; + } + break; } // optional bool duplicable = 3 [default = false]; - if (cached_has_bits & 0x00000004u) { - ::google::protobuf::internal::WireFormatLite::WriteBool( - 3, this->duplicable(), output); + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + set_has_duplicable(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &duplicable_))); + } else { + goto handle_unusual; + } + break; } // optional bool intermediate = 4 [default = false]; - if (cached_has_bits & 0x00000008u) { - ::google::protobuf::internal::WireFormatLite::WriteBool( - 4, this->intermediate(), output); + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + set_has_intermediate(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &intermediate_))); + } else { + goto handle_unusual; + } + break; } // optional bool dispensable = 5 [default = false]; - if (cached_has_bits & 0x00000010u) { - ::google::protobuf::internal::WireFormatLite::WriteBool( - 5, this->dispensable(), output); - } + case 5: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + set_has_dispensable(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &dispensable_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.OpProto.Var) + return true; +failure: + // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.OpProto.Var) + return false; +#undef DO_ +} - output->WriteRaw( - _internal_metadata_.unknown_fields().data(), - static_cast(_internal_metadata_.unknown_fields().size())); - // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.OpProto.Var) +void OpProto_Var::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream *output) const { + // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.OpProto.Var) + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required string name = 1; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // required string comment = 2; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->comment(), output); + } + + // optional bool duplicable = 3 [default = false]; + if (cached_has_bits & 0x00000004u) { + ::google::protobuf::internal::WireFormatLite::WriteBool( + 3, this->duplicable(), output); + } + + // optional bool intermediate = 4 [default = false]; + if (cached_has_bits & 0x00000008u) { + ::google::protobuf::internal::WireFormatLite::WriteBool( + 4, this->intermediate(), output); + } + + // optional bool dispensable = 5 [default = false]; + if (cached_has_bits & 0x00000010u) { + ::google::protobuf::internal::WireFormatLite::WriteBool( + 5, this->dispensable(), output); + } + + output->WriteRaw( + _internal_metadata_.unknown_fields().data(), + static_cast(_internal_metadata_.unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.OpProto.Var) } size_t OpProto_Var::RequiredFieldsByteSizeFallback() const { - // @@protoc_insertion_point(required_fields_byte_size_fallback_start:paddle_mobile.framework.proto.OpProto.Var) - size_t total_size = 0; + // @@protoc_insertion_point(required_fields_byte_size_fallback_start:paddle_mobile.framework.proto.OpProto.Var) + size_t total_size = 0; - if (has_name()) { - // required string name = 1; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->name()); - } + if (has_name()) { + // required string name = 1; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } - if (has_comment()) { - // required string comment = 2; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->comment()); - } + if (has_comment()) { + // required string comment = 2; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->comment()); + } - return total_size; + return total_size; } size_t OpProto_Var::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.OpProto.Var) - size_t total_size = 0; - - total_size += _internal_metadata_.unknown_fields().size(); - - if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == - 0) { // All required fields are present. - // required string name = 1; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->name()); - - // required string comment = 2; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->comment()); - - } else { - total_size += RequiredFieldsByteSizeFallback(); - } - if (_has_bits_[0 / 32] & 28u) { - // optional bool duplicable = 3 [default = false]; - if (has_duplicable()) { - total_size += 1 + 1; - } + // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.OpProto.Var) + size_t total_size = 0; - // optional bool intermediate = 4 [default = false]; - if (has_intermediate()) { - total_size += 1 + 1; - } + total_size += _internal_metadata_.unknown_fields().size(); - // optional bool dispensable = 5 [default = false]; - if (has_dispensable()) { - total_size += 1 + 1; - } + if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == + 0) { // All required fields are present. + // required string name = 1; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + + // required string comment = 2; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->comment()); + + } else { + total_size += RequiredFieldsByteSizeFallback(); + } + if (_has_bits_[0 / 32] & 28u) { + // optional bool duplicable = 3 [default = false]; + if (has_duplicable()) { + total_size += 1 + 1; + } + + // optional bool intermediate = 4 [default = false]; + if (has_intermediate()) { + total_size += 1 + 1; + } + + // optional bool dispensable = 5 [default = false]; + if (has_dispensable()) { + total_size += 1 + 1; } - int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; } void OpProto_Var::CheckTypeAndMergeFrom( const ::google::protobuf::MessageLite &from) { - MergeFrom(*::google::protobuf::down_cast(&from)); + MergeFrom(*::google::protobuf::down_cast(&from)); } void OpProto_Var::MergeFrom(const OpProto_Var &from) { - // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.OpProto.Var) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = from._has_bits_[0]; - if (cached_has_bits & 31u) { - if (cached_has_bits & 0x00000001u) { - set_has_name(); - name_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.name_); - } - if (cached_has_bits & 0x00000002u) { - set_has_comment(); - comment_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.comment_); - } - if (cached_has_bits & 0x00000004u) { - duplicable_ = from.duplicable_; - } - if (cached_has_bits & 0x00000008u) { - intermediate_ = from.intermediate_; - } - if (cached_has_bits & 0x00000010u) { - dispensable_ = from.dispensable_; - } - _has_bits_[0] |= cached_has_bits; + // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.OpProto.Var) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 31u) { + if (cached_has_bits & 0x00000001u) { + set_has_name(); + name_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.name_); } + if (cached_has_bits & 0x00000002u) { + set_has_comment(); + comment_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.comment_); + } + if (cached_has_bits & 0x00000004u) { + duplicable_ = from.duplicable_; + } + if (cached_has_bits & 0x00000008u) { + intermediate_ = from.intermediate_; + } + if (cached_has_bits & 0x00000010u) { + dispensable_ = from.dispensable_; + } + _has_bits_[0] |= cached_has_bits; + } } void OpProto_Var::CopyFrom(const OpProto_Var &from) { - // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.OpProto.Var) - if (&from == this) - return; - Clear(); - MergeFrom(from); + // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.OpProto.Var) + if (&from == this) + return; + Clear(); + MergeFrom(from); } bool OpProto_Var::IsInitialized() const { - if ((_has_bits_[0] & 0x00000003) != 0x00000003) - return false; - return true; + if ((_has_bits_[0] & 0x00000003) != 0x00000003) + return false; + return true; } void OpProto_Var::Swap(OpProto_Var *other) { - if (other == this) - return; - InternalSwap(other); + if (other == this) + return; + InternalSwap(other); } void OpProto_Var::InternalSwap(OpProto_Var *other) { - using std::swap; - name_.Swap(&other->name_); - comment_.Swap(&other->comment_); - swap(duplicable_, other->duplicable_); - swap(intermediate_, other->intermediate_); - swap(dispensable_, other->dispensable_); - swap(_has_bits_[0], other->_has_bits_[0]); - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); + using std::swap; + name_.Swap(&other->name_); + comment_.Swap(&other->comment_); + swap(duplicable_, other->duplicable_); + swap(intermediate_, other->intermediate_); + swap(dispensable_, other->dispensable_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); } ::std::string OpProto_Var::GetTypeName() const { - return "paddle_mobile.framework.proto.OpProto.Var"; + return "paddle_mobile.framework.proto.OpProto.Var"; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -2722,203 +2682,200 @@ void OpProto_Var::InternalSwap(OpProto_Var *other) { // required string name = 1; bool OpProto_Var::has_name() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } void OpProto_Var::set_has_name() { _has_bits_[0] |= 0x00000001u; } void OpProto_Var::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } void OpProto_Var::clear_name() { - name_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_name(); + name_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); } const ::std::string &OpProto_Var::name() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.name) - return name_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.name) + return name_.GetNoArena(); } void OpProto_Var::set_name(const ::std::string &value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.name) } #if LANG_CXX11 void OpProto_Var::set_name(::std::string &&value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.Var.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.Var.name) } #endif void OpProto_Var::set_name(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.Var.name) + GOOGLE_DCHECK(value != NULL); + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.Var.name) } void OpProto_Var::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:paddle_mobile.framework.proto.OpProto.Var.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.Var.name) } ::std::string *OpProto_Var::mutable_name() { - set_has_name(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.Var.name) - return name_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_name(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.Var.name) + return name_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string *OpProto_Var::release_name() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.Var.name) - clear_has_name(); - return name_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.Var.name) + clear_has_name(); + return name_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void OpProto_Var::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:paddle_mobile.framework.proto.OpProto.Var.name) + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpProto.Var.name) } // required string comment = 2; bool OpProto_Var::has_comment() const { - return (_has_bits_[0] & 0x00000002u) != 0; + return (_has_bits_[0] & 0x00000002u) != 0; } void OpProto_Var::set_has_comment() { _has_bits_[0] |= 0x00000002u; } void OpProto_Var::clear_has_comment() { _has_bits_[0] &= ~0x00000002u; } void OpProto_Var::clear_comment() { - comment_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_comment(); + comment_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_comment(); } const ::std::string &OpProto_Var::comment() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.comment) - return comment_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.comment) + return comment_.GetNoArena(); } void OpProto_Var::set_comment(const ::std::string &value) { - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.comment) + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.comment) } #if LANG_CXX11 void OpProto_Var::set_comment(::std::string &&value) { - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.Var.comment) + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.Var.comment) } #endif void OpProto_Var::set_comment(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.Var.comment) + GOOGLE_DCHECK(value != NULL); + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.Var.comment) } void OpProto_Var::set_comment(const char *value, size_t size) { - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.Var.comment) + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.Var.comment) } ::std::string *OpProto_Var::mutable_comment() { - set_has_comment(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.Var.comment) - return comment_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_comment(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.Var.comment) + return comment_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string *OpProto_Var::release_comment() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.Var.comment) - clear_has_comment(); - return comment_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.Var.comment) + clear_has_comment(); + return comment_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void OpProto_Var::set_allocated_comment(::std::string *comment) { - if (comment != NULL) { - set_has_comment(); - } else { - clear_has_comment(); - } - comment_.SetAllocatedNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), comment); - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpProto.Var.comment) + if (comment != NULL) { + set_has_comment(); + } else { + clear_has_comment(); + } + comment_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), comment); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpProto.Var.comment) } // optional bool duplicable = 3 [default = false]; bool OpProto_Var::has_duplicable() const { - return (_has_bits_[0] & 0x00000004u) != 0; + return (_has_bits_[0] & 0x00000004u) != 0; } void OpProto_Var::set_has_duplicable() { _has_bits_[0] |= 0x00000004u; } void OpProto_Var::clear_has_duplicable() { _has_bits_[0] &= ~0x00000004u; } void OpProto_Var::clear_duplicable() { - duplicable_ = false; - clear_has_duplicable(); + duplicable_ = false; + clear_has_duplicable(); } bool OpProto_Var::duplicable() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.duplicable) - return duplicable_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.duplicable) + return duplicable_; } void OpProto_Var::set_duplicable(bool value) { - set_has_duplicable(); - duplicable_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.duplicable) + set_has_duplicable(); + duplicable_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.duplicable) } // optional bool intermediate = 4 [default = false]; bool OpProto_Var::has_intermediate() const { - return (_has_bits_[0] & 0x00000008u) != 0; + return (_has_bits_[0] & 0x00000008u) != 0; } void OpProto_Var::set_has_intermediate() { _has_bits_[0] |= 0x00000008u; } void OpProto_Var::clear_has_intermediate() { _has_bits_[0] &= ~0x00000008u; } void OpProto_Var::clear_intermediate() { - intermediate_ = false; - clear_has_intermediate(); + intermediate_ = false; + clear_has_intermediate(); } bool OpProto_Var::intermediate() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.intermediate) - return intermediate_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.intermediate) + return intermediate_; } void OpProto_Var::set_intermediate(bool value) { - set_has_intermediate(); - intermediate_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.intermediate) + set_has_intermediate(); + intermediate_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.intermediate) } // optional bool dispensable = 5 [default = false]; bool OpProto_Var::has_dispensable() const { - return (_has_bits_[0] & 0x00000010u) != 0; + return (_has_bits_[0] & 0x00000010u) != 0; } void OpProto_Var::set_has_dispensable() { _has_bits_[0] |= 0x00000010u; } void OpProto_Var::clear_has_dispensable() { _has_bits_[0] &= ~0x00000010u; } void OpProto_Var::clear_dispensable() { - dispensable_ = false; - clear_has_dispensable(); + dispensable_ = false; + clear_has_dispensable(); } bool OpProto_Var::dispensable() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.dispensable) - return dispensable_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.dispensable) + return dispensable_; } void OpProto_Var::set_dispensable(bool value) { - set_has_dispensable(); - dispensable_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.dispensable) + set_has_dispensable(); + dispensable_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.dispensable) } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS - // =================================================================== + // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int OpProto_Attr::kNameFieldNumber; @@ -2929,387 +2886,377 @@ const int OpProto_Attr::kGeneratedFieldNumber; OpProto_Attr::OpProto_Attr() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_framework_2eproto::InitDefaults(); - } - SharedCtor(); - // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.OpProto.Attr) + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + protobuf_framework_2eproto::InitDefaults(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.OpProto.Attr) } OpProto_Attr::OpProto_Attr(const OpProto_Attr &from) : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - name_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.has_name()) { - name_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.name_); - } - comment_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.has_comment()) { - comment_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.comment_); - } - ::memcpy(&type_, &from.type_, - static_cast(reinterpret_cast(&generated_) - - reinterpret_cast(&type_)) + - sizeof(generated_)); - // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.OpProto.Attr) + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_name()) { + name_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.name_); + } + comment_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_comment()) { + comment_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.comment_); + } + ::memcpy(&type_, &from.type_, + static_cast(reinterpret_cast(&generated_) - + reinterpret_cast(&type_)) + + sizeof(generated_)); + // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.OpProto.Attr) } void OpProto_Attr::SharedCtor() { - _cached_size_ = 0; - name_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - comment_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - ::memset(&type_, 0, - static_cast(reinterpret_cast(&generated_) - - reinterpret_cast(&type_)) + - sizeof(generated_)); + _cached_size_ = 0; + name_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + comment_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&type_, 0, + static_cast(reinterpret_cast(&generated_) - + reinterpret_cast(&type_)) + + sizeof(generated_)); } OpProto_Attr::~OpProto_Attr() { - // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.OpProto.Attr) - SharedDtor(); + // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.OpProto.Attr) + SharedDtor(); } void OpProto_Attr::SharedDtor() { - name_.DestroyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - comment_.DestroyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + comment_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void OpProto_Attr::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const OpProto_Attr &OpProto_Attr::default_instance() { - protobuf_framework_2eproto::InitDefaults(); - return *internal_default_instance(); + protobuf_framework_2eproto::InitDefaults(); + return *internal_default_instance(); } OpProto_Attr *OpProto_Attr::New(::google::protobuf::Arena *arena) const { - OpProto_Attr *n = new OpProto_Attr; - if (arena != NULL) { - arena->Own(n); - } - return n; + OpProto_Attr *n = new OpProto_Attr; + if (arena != NULL) { + arena->Own(n); + } + return n; } void OpProto_Attr::Clear() { - // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.OpProto.Attr) - ::google::protobuf::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void)cached_has_bits; - - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 3u) { - if (cached_has_bits & 0x00000001u) { - GOOGLE_DCHECK(!name_.IsDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*name_.UnsafeRawStringPointer())->clear(); - } - if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(!comment_.IsDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*comment_.UnsafeRawStringPointer())->clear(); - } + // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.OpProto.Attr) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 3u) { + if (cached_has_bits & 0x00000001u) { + GOOGLE_DCHECK(!name_.IsDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited())); + (*name_.UnsafeRawStringPointer())->clear(); } - if (cached_has_bits & 12u) { - ::memset(&type_, 0, - static_cast(reinterpret_cast(&generated_) - - reinterpret_cast(&type_)) + - sizeof(generated_)); + if (cached_has_bits & 0x00000002u) { + GOOGLE_DCHECK(!comment_.IsDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited())); + (*comment_.UnsafeRawStringPointer())->clear(); } - _has_bits_.Clear(); - _internal_metadata_.Clear(); + } + if (cached_has_bits & 12u) { + ::memset(&type_, 0, + static_cast(reinterpret_cast(&generated_) - + reinterpret_cast(&type_)) + + sizeof(generated_)); + } + _has_bits_.Clear(); + _internal_metadata_.Clear(); } bool OpProto_Attr::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::NewPermanentCallback( - &_internal_metadata_, - &::google::protobuf::internal::InternalMetadataWithArenaLite:: - mutable_unknown_fields)); - ::google::protobuf::io::CodedOutputStream unknown_fields_stream( - &unknown_fields_string, false); - // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.OpProto.Attr) - for (;;) { - ::std::pair<::google::protobuf::uint32, bool> p = - input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) - goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber( - tag)) { - // required string name = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_name())); - } else { - goto handle_unusual; - } - break; - } - - // required .paddle_mobile.framework.proto.AttrType type = - // 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { - int value; - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - int, ::google::protobuf::internal::WireFormatLite:: - TYPE_ENUM>(input, &value))); - if (::paddle_mobile::framework::proto::AttrType_IsValid( - value)) { - set_type(static_cast< - ::paddle_mobile::framework::proto::AttrType>( - value)); - } else { - unknown_fields_stream.WriteVarint32(16u); - unknown_fields_stream.WriteVarint32( - static_cast<::google::protobuf::uint32>(value)); - } - } else { - goto handle_unusual; - } - break; - } - - // required string comment = 3; - case 3: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_comment())); - } else { - goto handle_unusual; - } - break; - } - - // optional bool generated = 4 [default = false]; - case 4: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { - set_has_generated(); - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - bool, ::google::protobuf::internal::WireFormatLite:: - TYPE_BOOL>(input, &generated_))); - } else { - goto handle_unusual; - } - break; - } + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ + goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::NewPermanentCallback( + &_internal_metadata_, + &::google::protobuf::internal::InternalMetadataWithArenaLite:: + mutable_unknown_fields)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.OpProto.Attr) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = + input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) + goto handle_unusual; + switch ( + ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required string name = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + } else { + goto handle_unusual; + } + break; + } + + // required .paddle_mobile.framework.proto.AttrType type = + // 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::paddle_mobile::framework::proto::AttrType_IsValid(value)) { + set_type( + static_cast<::paddle_mobile::framework::proto::AttrType>(value)); + } else { + unknown_fields_stream.WriteVarint32(16u); + unknown_fields_stream.WriteVarint32( + static_cast<::google::protobuf::uint32>(value)); + } + } else { + goto handle_unusual; + } + break; + } - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } - } + // required string comment = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_comment())); + } else { + goto handle_unusual; + } + break; } + + // optional bool generated = 4 [default = false]; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(32u /* 32 & 0xFF */)) { + set_has_generated(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &generated_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } success: - // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.OpProto.Attr) - return true; + // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.OpProto.Attr) + return true; failure: - // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.OpProto.Attr) - return false; + // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.OpProto.Attr) + return false; #undef DO_ } void OpProto_Attr::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream *output) const { - // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.OpProto.Attr) - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _has_bits_[0]; - // required string name = 1; - if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->name(), output); - } - - // required .paddle_mobile.framework.proto.AttrType type = 2; - if (cached_has_bits & 0x00000004u) { - ::google::protobuf::internal::WireFormatLite::WriteEnum(2, this->type(), - output); - } - - // required string comment = 3; - if (cached_has_bits & 0x00000002u) { - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 3, this->comment(), output); - } - - // optional bool generated = 4 [default = false]; - if (cached_has_bits & 0x00000008u) { - ::google::protobuf::internal::WireFormatLite::WriteBool( - 4, this->generated(), output); - } - - output->WriteRaw( - _internal_metadata_.unknown_fields().data(), - static_cast(_internal_metadata_.unknown_fields().size())); - // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.OpProto.Attr) + // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.OpProto.Attr) + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required string name = 1; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // required .paddle_mobile.framework.proto.AttrType type = 2; + if (cached_has_bits & 0x00000004u) { + ::google::protobuf::internal::WireFormatLite::WriteEnum(2, this->type(), + output); + } + + // required string comment = 3; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->comment(), output); + } + + // optional bool generated = 4 [default = false]; + if (cached_has_bits & 0x00000008u) { + ::google::protobuf::internal::WireFormatLite::WriteBool( + 4, this->generated(), output); + } + + output->WriteRaw( + _internal_metadata_.unknown_fields().data(), + static_cast(_internal_metadata_.unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.OpProto.Attr) } size_t OpProto_Attr::RequiredFieldsByteSizeFallback() const { - // @@protoc_insertion_point(required_fields_byte_size_fallback_start:paddle_mobile.framework.proto.OpProto.Attr) - size_t total_size = 0; + // @@protoc_insertion_point(required_fields_byte_size_fallback_start:paddle_mobile.framework.proto.OpProto.Attr) + size_t total_size = 0; - if (has_name()) { - // required string name = 1; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->name()); - } + if (has_name()) { + // required string name = 1; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } - if (has_comment()) { - // required string comment = 3; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->comment()); - } + if (has_comment()) { + // required string comment = 3; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->comment()); + } - if (has_type()) { - // required .paddle_mobile.framework.proto.AttrType type = - // 2; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::EnumSize( - this->type()); - } + if (has_type()) { + // required .paddle_mobile.framework.proto.AttrType type = + // 2; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize( + this->type()); + } - return total_size; + return total_size; } size_t OpProto_Attr::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.OpProto.Attr) - size_t total_size = 0; + // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.OpProto.Attr) + size_t total_size = 0; - total_size += _internal_metadata_.unknown_fields().size(); + total_size += _internal_metadata_.unknown_fields().size(); - if (((_has_bits_[0] & 0x00000007) ^ 0x00000007) == - 0) { // All required fields are present. - // required string name = 1; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->name()); + if (((_has_bits_[0] & 0x00000007) ^ 0x00000007) == + 0) { // All required fields are present. + // required string name = 1; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); - // required string comment = 3; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->comment()); + // required string comment = 3; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->comment()); - // required .paddle_mobile.framework.proto.AttrType type = - // 2; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::EnumSize( - this->type()); + // required .paddle_mobile.framework.proto.AttrType type = + // 2; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize( + this->type()); - } else { - total_size += RequiredFieldsByteSizeFallback(); - } - // optional bool generated = 4 [default = false]; - if (has_generated()) { - total_size += 1 + 1; - } + } else { + total_size += RequiredFieldsByteSizeFallback(); + } + // optional bool generated = 4 [default = false]; + if (has_generated()) { + total_size += 1 + 1; + } - int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; } void OpProto_Attr::CheckTypeAndMergeFrom( const ::google::protobuf::MessageLite &from) { - MergeFrom(*::google::protobuf::down_cast(&from)); + MergeFrom(*::google::protobuf::down_cast(&from)); } void OpProto_Attr::MergeFrom(const OpProto_Attr &from) { - // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.OpProto.Attr) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = from._has_bits_[0]; - if (cached_has_bits & 15u) { - if (cached_has_bits & 0x00000001u) { - set_has_name(); - name_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.name_); - } - if (cached_has_bits & 0x00000002u) { - set_has_comment(); - comment_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.comment_); - } - if (cached_has_bits & 0x00000004u) { - type_ = from.type_; - } - if (cached_has_bits & 0x00000008u) { - generated_ = from.generated_; - } - _has_bits_[0] |= cached_has_bits; + // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.OpProto.Attr) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 15u) { + if (cached_has_bits & 0x00000001u) { + set_has_name(); + name_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.name_); } + if (cached_has_bits & 0x00000002u) { + set_has_comment(); + comment_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.comment_); + } + if (cached_has_bits & 0x00000004u) { + type_ = from.type_; + } + if (cached_has_bits & 0x00000008u) { + generated_ = from.generated_; + } + _has_bits_[0] |= cached_has_bits; + } } void OpProto_Attr::CopyFrom(const OpProto_Attr &from) { - // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.OpProto.Attr) - if (&from == this) - return; - Clear(); - MergeFrom(from); + // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.OpProto.Attr) + if (&from == this) + return; + Clear(); + MergeFrom(from); } bool OpProto_Attr::IsInitialized() const { - if ((_has_bits_[0] & 0x00000007) != 0x00000007) - return false; - return true; + if ((_has_bits_[0] & 0x00000007) != 0x00000007) + return false; + return true; } void OpProto_Attr::Swap(OpProto_Attr *other) { - if (other == this) - return; - InternalSwap(other); + if (other == this) + return; + InternalSwap(other); } void OpProto_Attr::InternalSwap(OpProto_Attr *other) { - using std::swap; - name_.Swap(&other->name_); - comment_.Swap(&other->comment_); - swap(type_, other->type_); - swap(generated_, other->generated_); - swap(_has_bits_[0], other->_has_bits_[0]); - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); + using std::swap; + name_.Swap(&other->name_); + comment_.Swap(&other->comment_); + swap(type_, other->type_); + swap(generated_, other->generated_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); } ::std::string OpProto_Attr::GetTypeName() const { - return "paddle_mobile.framework.proto.OpProto.Attr"; + return "paddle_mobile.framework.proto.OpProto.Attr"; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -3317,184 +3264,181 @@ void OpProto_Attr::InternalSwap(OpProto_Attr *other) { // required string name = 1; bool OpProto_Attr::has_name() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } void OpProto_Attr::set_has_name() { _has_bits_[0] |= 0x00000001u; } void OpProto_Attr::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } void OpProto_Attr::clear_name() { - name_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_name(); + name_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); } const ::std::string &OpProto_Attr::name() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Attr.name) - return name_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Attr.name) + return name_.GetNoArena(); } void OpProto_Attr::set_name(const ::std::string &value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Attr.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Attr.name) } #if LANG_CXX11 void OpProto_Attr::set_name(::std::string &&value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.Attr.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.Attr.name) } #endif void OpProto_Attr::set_name(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.Attr.name) + GOOGLE_DCHECK(value != NULL); + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.Attr.name) } void OpProto_Attr::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:paddle_mobile.framework.proto.OpProto.Attr.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.Attr.name) } ::std::string *OpProto_Attr::mutable_name() { - set_has_name(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.Attr.name) - return name_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_name(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.Attr.name) + return name_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string *OpProto_Attr::release_name() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.Attr.name) - clear_has_name(); - return name_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.Attr.name) + clear_has_name(); + return name_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void OpProto_Attr::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:paddle_mobile.framework.proto.OpProto.Attr.name) + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpProto.Attr.name) } // required .paddle_mobile.framework.proto.AttrType type = 2; bool OpProto_Attr::has_type() const { - return (_has_bits_[0] & 0x00000004u) != 0; + return (_has_bits_[0] & 0x00000004u) != 0; } void OpProto_Attr::set_has_type() { _has_bits_[0] |= 0x00000004u; } void OpProto_Attr::clear_has_type() { _has_bits_[0] &= ~0x00000004u; } void OpProto_Attr::clear_type() { - type_ = 0; - clear_has_type(); + type_ = 0; + clear_has_type(); } ::paddle_mobile::framework::proto::AttrType OpProto_Attr::type() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Attr.type) - return static_cast<::paddle_mobile::framework::proto::AttrType>(type_); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Attr.type) + return static_cast<::paddle_mobile::framework::proto::AttrType>(type_); } void OpProto_Attr::set_type(::paddle_mobile::framework::proto::AttrType value) { - assert(::paddle_mobile::framework::proto::AttrType_IsValid(value)); - set_has_type(); - type_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Attr.type) + assert(::paddle_mobile::framework::proto::AttrType_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Attr.type) } // required string comment = 3; bool OpProto_Attr::has_comment() const { - return (_has_bits_[0] & 0x00000002u) != 0; + return (_has_bits_[0] & 0x00000002u) != 0; } void OpProto_Attr::set_has_comment() { _has_bits_[0] |= 0x00000002u; } void OpProto_Attr::clear_has_comment() { _has_bits_[0] &= ~0x00000002u; } void OpProto_Attr::clear_comment() { - comment_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_comment(); + comment_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_comment(); } const ::std::string &OpProto_Attr::comment() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Attr.comment) - return comment_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Attr.comment) + return comment_.GetNoArena(); } void OpProto_Attr::set_comment(const ::std::string &value) { - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Attr.comment) + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Attr.comment) } #if LANG_CXX11 void OpProto_Attr::set_comment(::std::string &&value) { - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.Attr.comment) + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.Attr.comment) } #endif void OpProto_Attr::set_comment(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.Attr.comment) + GOOGLE_DCHECK(value != NULL); + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.Attr.comment) } void OpProto_Attr::set_comment(const char *value, size_t size) { - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.Attr.comment) + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.Attr.comment) } ::std::string *OpProto_Attr::mutable_comment() { - set_has_comment(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.Attr.comment) - return comment_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_comment(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.Attr.comment) + return comment_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string *OpProto_Attr::release_comment() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.Attr.comment) - clear_has_comment(); - return comment_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.Attr.comment) + clear_has_comment(); + return comment_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void OpProto_Attr::set_allocated_comment(::std::string *comment) { - if (comment != NULL) { - set_has_comment(); - } else { - clear_has_comment(); - } - comment_.SetAllocatedNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), comment); - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpProto.Attr.comment) + if (comment != NULL) { + set_has_comment(); + } else { + clear_has_comment(); + } + comment_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), comment); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpProto.Attr.comment) } // optional bool generated = 4 [default = false]; bool OpProto_Attr::has_generated() const { - return (_has_bits_[0] & 0x00000008u) != 0; + return (_has_bits_[0] & 0x00000008u) != 0; } void OpProto_Attr::set_has_generated() { _has_bits_[0] |= 0x00000008u; } void OpProto_Attr::clear_has_generated() { _has_bits_[0] &= ~0x00000008u; } void OpProto_Attr::clear_generated() { - generated_ = false; - clear_has_generated(); + generated_ = false; + clear_has_generated(); } bool OpProto_Attr::generated() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Attr.generated) - return generated_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Attr.generated) + return generated_; } void OpProto_Attr::set_generated(bool value) { - set_has_generated(); - generated_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Attr.generated) + set_has_generated(); + generated_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Attr.generated) } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS - // =================================================================== + // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int OpProto::kTypeFieldNumber; @@ -3506,405 +3450,403 @@ const int OpProto::kCommentFieldNumber; OpProto::OpProto() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_framework_2eproto::InitDefaults(); - } - SharedCtor(); - // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.OpProto) + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + protobuf_framework_2eproto::InitDefaults(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.OpProto) } OpProto::OpProto(const OpProto &from) : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0), inputs_(from.inputs_), outputs_(from.outputs_), attrs_(from.attrs_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - type_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.has_type()) { - type_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.type_); - } - comment_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.has_comment()) { - comment_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.comment_); - } - // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.OpProto) + _internal_metadata_.MergeFrom(from._internal_metadata_); + type_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_type()) { + type_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.type_); + } + comment_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_comment()) { + comment_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.comment_); + } + // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.OpProto) } void OpProto::SharedCtor() { - _cached_size_ = 0; - type_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - comment_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + _cached_size_ = 0; + type_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + comment_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } OpProto::~OpProto() { - // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.OpProto) - SharedDtor(); + // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.OpProto) + SharedDtor(); } void OpProto::SharedDtor() { - type_.DestroyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - comment_.DestroyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + comment_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void OpProto::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const OpProto &OpProto::default_instance() { - protobuf_framework_2eproto::InitDefaults(); - return *internal_default_instance(); + protobuf_framework_2eproto::InitDefaults(); + return *internal_default_instance(); } OpProto *OpProto::New(::google::protobuf::Arena *arena) const { - OpProto *n = new OpProto; - if (arena != NULL) { - arena->Own(n); - } - return n; + OpProto *n = new OpProto; + if (arena != NULL) { + arena->Own(n); + } + return n; } void OpProto::Clear() { - // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.OpProto) - ::google::protobuf::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void)cached_has_bits; - - inputs_.Clear(); - outputs_.Clear(); - attrs_.Clear(); - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 3u) { - if (cached_has_bits & 0x00000001u) { - GOOGLE_DCHECK(!type_.IsDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*type_.UnsafeRawStringPointer())->clear(); - } - if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(!comment_.IsDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*comment_.UnsafeRawStringPointer())->clear(); - } + // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.OpProto) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + inputs_.Clear(); + outputs_.Clear(); + attrs_.Clear(); + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 3u) { + if (cached_has_bits & 0x00000001u) { + GOOGLE_DCHECK(!type_.IsDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited())); + (*type_.UnsafeRawStringPointer())->clear(); } - _has_bits_.Clear(); - _internal_metadata_.Clear(); + if (cached_has_bits & 0x00000002u) { + GOOGLE_DCHECK(!comment_.IsDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited())); + (*comment_.UnsafeRawStringPointer())->clear(); + } + } + _has_bits_.Clear(); + _internal_metadata_.Clear(); } bool OpProto::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::NewPermanentCallback( - &_internal_metadata_, - &::google::protobuf::internal::InternalMetadataWithArenaLite:: - mutable_unknown_fields)); - ::google::protobuf::io::CodedOutputStream unknown_fields_stream( - &unknown_fields_string, false); - // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.OpProto) - for (;;) { - ::std::pair<::google::protobuf::uint32, bool> p = - input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) - goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber( - tag)) { - // required string type = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_type())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .paddle_mobile.framework.proto.OpProto.Var - // inputs = 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite:: - ReadMessageNoVirtual(input, add_inputs())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .paddle_mobile.framework.proto.OpProto.Var - // outputs = 3; - case 3: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite:: - ReadMessageNoVirtual(input, add_outputs())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .paddle_mobile.framework.proto.OpProto.Attr - // attrs = 4; - case 4: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite:: - ReadMessageNoVirtual(input, add_attrs())); - } else { - goto handle_unusual; - } - break; - } - - // required string comment = 5; - case 5: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_comment())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } - } + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ + goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::NewPermanentCallback( + &_internal_metadata_, + &::google::protobuf::internal::InternalMetadataWithArenaLite:: + mutable_unknown_fields)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.OpProto) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = + input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) + goto handle_unusual; + switch ( + ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required string type = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_type())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .paddle_mobile.framework.proto.OpProto.Var + // inputs = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_inputs())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .paddle_mobile.framework.proto.OpProto.Var + // outputs = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_outputs())); + } else { + goto handle_unusual; + } + break; + } + + // repeated .paddle_mobile.framework.proto.OpProto.Attr + // attrs = 4; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_attrs())); + } else { + goto handle_unusual; + } + break; } + + // required string comment = 5; + case 5: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_comment())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } success: - // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.OpProto) - return true; + // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.OpProto) + return true; failure: - // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.OpProto) - return false; + // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.OpProto) + return false; #undef DO_ } void OpProto::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream *output) const { - // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.OpProto) - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _has_bits_[0]; - // required string type = 1; - if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->type(), output); - } - - // repeated .paddle_mobile.framework.proto.OpProto.Var inputs = - // 2; - for (unsigned int i = 0, n = static_cast(this->inputs_size()); - i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 2, this->inputs(static_cast(i)), output); - } - - // repeated .paddle_mobile.framework.proto.OpProto.Var outputs = - // 3; - for (unsigned int i = 0, - n = static_cast(this->outputs_size()); - i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 3, this->outputs(static_cast(i)), output); - } - - // repeated .paddle_mobile.framework.proto.OpProto.Attr attrs = - // 4; - for (unsigned int i = 0, n = static_cast(this->attrs_size()); - i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 4, this->attrs(static_cast(i)), output); - } - - // required string comment = 5; - if (cached_has_bits & 0x00000002u) { - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 5, this->comment(), output); - } - - output->WriteRaw( - _internal_metadata_.unknown_fields().data(), - static_cast(_internal_metadata_.unknown_fields().size())); - // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.OpProto) + // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.OpProto) + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required string type = 1; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->type(), output); + } + + // repeated .paddle_mobile.framework.proto.OpProto.Var inputs = + // 2; + for (unsigned int i = 0, n = static_cast(this->inputs_size()); + i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->inputs(static_cast(i)), output); + } + + // repeated .paddle_mobile.framework.proto.OpProto.Var outputs = + // 3; + for (unsigned int i = 0, n = static_cast(this->outputs_size()); + i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 3, this->outputs(static_cast(i)), output); + } + + // repeated .paddle_mobile.framework.proto.OpProto.Attr attrs = + // 4; + for (unsigned int i = 0, n = static_cast(this->attrs_size()); + i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 4, this->attrs(static_cast(i)), output); + } + + // required string comment = 5; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 5, this->comment(), output); + } + + output->WriteRaw( + _internal_metadata_.unknown_fields().data(), + static_cast(_internal_metadata_.unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.OpProto) } size_t OpProto::RequiredFieldsByteSizeFallback() const { - // @@protoc_insertion_point(required_fields_byte_size_fallback_start:paddle_mobile.framework.proto.OpProto) - size_t total_size = 0; + // @@protoc_insertion_point(required_fields_byte_size_fallback_start:paddle_mobile.framework.proto.OpProto) + size_t total_size = 0; - if (has_type()) { - // required string type = 1; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->type()); - } + if (has_type()) { + // required string type = 1; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->type()); + } - if (has_comment()) { - // required string comment = 5; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->comment()); - } + if (has_comment()) { + // required string comment = 5; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->comment()); + } - return total_size; + return total_size; } size_t OpProto::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.OpProto) - size_t total_size = 0; - - total_size += _internal_metadata_.unknown_fields().size(); - - if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == - 0) { // All required fields are present. - // required string type = 1; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->type()); - - // required string comment = 5; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->comment()); - - } else { - total_size += RequiredFieldsByteSizeFallback(); - } - // repeated .paddle_mobile.framework.proto.OpProto.Var inputs = - // 2; - { - unsigned int count = static_cast(this->inputs_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += ::google::protobuf::internal::WireFormatLite:: - MessageSizeNoVirtual(this->inputs(static_cast(i))); - } - } + // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.OpProto) + size_t total_size = 0; - // repeated .paddle_mobile.framework.proto.OpProto.Var outputs = - // 3; - { - unsigned int count = static_cast(this->outputs_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += ::google::protobuf::internal::WireFormatLite:: - MessageSizeNoVirtual(this->outputs(static_cast(i))); - } - } + total_size += _internal_metadata_.unknown_fields().size(); - // repeated .paddle_mobile.framework.proto.OpProto.Attr attrs = - // 4; - { - unsigned int count = static_cast(this->attrs_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += ::google::protobuf::internal::WireFormatLite:: - MessageSizeNoVirtual(this->attrs(static_cast(i))); - } - } + if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == + 0) { // All required fields are present. + // required string type = 1; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->type()); - int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; + // required string comment = 5; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->comment()); + + } else { + total_size += RequiredFieldsByteSizeFallback(); + } + // repeated .paddle_mobile.framework.proto.OpProto.Var inputs = + // 2; + { + unsigned int count = static_cast(this->inputs_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->inputs(static_cast(i))); + } + } + + // repeated .paddle_mobile.framework.proto.OpProto.Var outputs = + // 3; + { + unsigned int count = static_cast(this->outputs_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->outputs(static_cast(i))); + } + } + + // repeated .paddle_mobile.framework.proto.OpProto.Attr attrs = + // 4; + { + unsigned int count = static_cast(this->attrs_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->attrs(static_cast(i))); + } + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; } void OpProto::CheckTypeAndMergeFrom( const ::google::protobuf::MessageLite &from) { - MergeFrom(*::google::protobuf::down_cast(&from)); + MergeFrom(*::google::protobuf::down_cast(&from)); } void OpProto::MergeFrom(const OpProto &from) { - // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.OpProto) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - inputs_.MergeFrom(from.inputs_); - outputs_.MergeFrom(from.outputs_); - attrs_.MergeFrom(from.attrs_); - cached_has_bits = from._has_bits_[0]; - if (cached_has_bits & 3u) { - if (cached_has_bits & 0x00000001u) { - set_has_type(); - type_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.type_); - } - if (cached_has_bits & 0x00000002u) { - set_has_comment(); - comment_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.comment_); - } + // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.OpProto) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + inputs_.MergeFrom(from.inputs_); + outputs_.MergeFrom(from.outputs_); + attrs_.MergeFrom(from.attrs_); + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 3u) { + if (cached_has_bits & 0x00000001u) { + set_has_type(); + type_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.type_); + } + if (cached_has_bits & 0x00000002u) { + set_has_comment(); + comment_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.comment_); } + } } void OpProto::CopyFrom(const OpProto &from) { - // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.OpProto) - if (&from == this) - return; - Clear(); - MergeFrom(from); + // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.OpProto) + if (&from == this) + return; + Clear(); + MergeFrom(from); } bool OpProto::IsInitialized() const { - if ((_has_bits_[0] & 0x00000003) != 0x00000003) - return false; - if (!::google::protobuf::internal::AllAreInitialized(this->inputs())) - return false; - if (!::google::protobuf::internal::AllAreInitialized(this->outputs())) - return false; - if (!::google::protobuf::internal::AllAreInitialized(this->attrs())) - return false; - return true; + if ((_has_bits_[0] & 0x00000003) != 0x00000003) + return false; + if (!::google::protobuf::internal::AllAreInitialized(this->inputs())) + return false; + if (!::google::protobuf::internal::AllAreInitialized(this->outputs())) + return false; + if (!::google::protobuf::internal::AllAreInitialized(this->attrs())) + return false; + return true; } void OpProto::Swap(OpProto *other) { - if (other == this) - return; - InternalSwap(other); + if (other == this) + return; + InternalSwap(other); } void OpProto::InternalSwap(OpProto *other) { - using std::swap; - inputs_.InternalSwap(&other->inputs_); - outputs_.InternalSwap(&other->outputs_); - attrs_.InternalSwap(&other->attrs_); - type_.Swap(&other->type_); - comment_.Swap(&other->comment_); - swap(_has_bits_[0], other->_has_bits_[0]); - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); + using std::swap; + inputs_.InternalSwap(&other->inputs_); + outputs_.InternalSwap(&other->outputs_); + attrs_.InternalSwap(&other->attrs_); + type_.Swap(&other->type_); + comment_.Swap(&other->comment_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); } ::std::string OpProto::GetTypeName() const { - return "paddle_mobile.framework.proto.OpProto"; + return "paddle_mobile.framework.proto.OpProto"; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -3915,65 +3857,62 @@ bool OpProto::has_type() const { return (_has_bits_[0] & 0x00000001u) != 0; } void OpProto::set_has_type() { _has_bits_[0] |= 0x00000001u; } void OpProto::clear_has_type() { _has_bits_[0] &= ~0x00000001u; } void OpProto::clear_type() { - type_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_type(); + type_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_type(); } const ::std::string &OpProto::type() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.type) - return type_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.type) + return type_.GetNoArena(); } void OpProto::set_type(const ::std::string &value) { - set_has_type(); - type_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.type) + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.type) } #if LANG_CXX11 void OpProto::set_type(::std::string &&value) { - set_has_type(); - type_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.type) + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.type) } #endif void OpProto::set_type(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_type(); - type_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.type) + GOOGLE_DCHECK(value != NULL); + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.type) } void OpProto::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:paddle_mobile.framework.proto.OpProto.type) + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.type) } ::std::string *OpProto::mutable_type() { - set_has_type(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.type) - return type_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_type(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.type) + return type_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string *OpProto::release_type() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.type) - clear_has_type(); - return type_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.type) + clear_has_type(); + return type_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void OpProto::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:paddle_mobile.framework.proto.OpProto.type) + if (type != NULL) { + set_has_type(); + } else { + clear_has_type(); + } + type_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), type); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpProto.type) } // repeated .paddle_mobile.framework.proto.OpProto.Var inputs = 2; @@ -3981,29 +3920,29 @@ int OpProto::inputs_size() const { return inputs_.size(); } void OpProto::clear_inputs() { inputs_.Clear(); } const ::paddle_mobile::framework::proto::OpProto_Var & OpProto::inputs(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.inputs) - return inputs_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.inputs) + return inputs_.Get(index); } ::paddle_mobile::framework::proto::OpProto_Var * OpProto::mutable_inputs(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.inputs) - return inputs_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.inputs) + return inputs_.Mutable(index); } ::paddle_mobile::framework::proto::OpProto_Var *OpProto::add_inputs() { - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpProto.inputs) - return inputs_.Add(); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpProto.inputs) + return inputs_.Add(); } ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpProto_Var> * OpProto::mutable_inputs() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.inputs) - return &inputs_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.inputs) + return &inputs_; } const ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpProto_Var> & OpProto::inputs() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.inputs) - return inputs_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.inputs) + return inputs_; } // repeated .paddle_mobile.framework.proto.OpProto.Var outputs = 3; @@ -4011,29 +3950,29 @@ int OpProto::outputs_size() const { return outputs_.size(); } void OpProto::clear_outputs() { outputs_.Clear(); } const ::paddle_mobile::framework::proto::OpProto_Var & OpProto::outputs(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.outputs) - return outputs_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.outputs) + return outputs_.Get(index); } ::paddle_mobile::framework::proto::OpProto_Var * OpProto::mutable_outputs(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.outputs) - return outputs_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.outputs) + return outputs_.Mutable(index); } ::paddle_mobile::framework::proto::OpProto_Var *OpProto::add_outputs() { - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpProto.outputs) - return outputs_.Add(); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpProto.outputs) + return outputs_.Add(); } ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpProto_Var> * OpProto::mutable_outputs() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.outputs) - return &outputs_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.outputs) + return &outputs_; } const ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpProto_Var> & OpProto::outputs() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.outputs) - return outputs_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.outputs) + return outputs_; } // repeated .paddle_mobile.framework.proto.OpProto.Attr attrs = 4; @@ -4041,29 +3980,29 @@ int OpProto::attrs_size() const { return attrs_.size(); } void OpProto::clear_attrs() { attrs_.Clear(); } const ::paddle_mobile::framework::proto::OpProto_Attr & OpProto::attrs(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.attrs) - return attrs_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.attrs) + return attrs_.Get(index); } ::paddle_mobile::framework::proto::OpProto_Attr * OpProto::mutable_attrs(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.attrs) - return attrs_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.attrs) + return attrs_.Mutable(index); } ::paddle_mobile::framework::proto::OpProto_Attr *OpProto::add_attrs() { - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpProto.attrs) - return attrs_.Add(); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpProto.attrs) + return attrs_.Add(); } ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpProto_Attr> * OpProto::mutable_attrs() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.attrs) - return &attrs_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.attrs) + return &attrs_; } const ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpProto_Attr> & OpProto::attrs() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.attrs) - return attrs_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.attrs) + return attrs_; } // required string comment = 5; @@ -4071,70 +4010,70 @@ bool OpProto::has_comment() const { return (_has_bits_[0] & 0x00000002u) != 0; } void OpProto::set_has_comment() { _has_bits_[0] |= 0x00000002u; } void OpProto::clear_has_comment() { _has_bits_[0] &= ~0x00000002u; } void OpProto::clear_comment() { - comment_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_comment(); + comment_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_comment(); } const ::std::string &OpProto::comment() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.comment) - return comment_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.comment) + return comment_.GetNoArena(); } void OpProto::set_comment(const ::std::string &value) { - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.comment) + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.comment) } #if LANG_CXX11 void OpProto::set_comment(::std::string &&value) { - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.comment) + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.comment) } #endif void OpProto::set_comment(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.comment) + GOOGLE_DCHECK(value != NULL); + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.comment) } void OpProto::set_comment(const char *value, size_t size) { - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.comment) + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.comment) } ::std::string *OpProto::mutable_comment() { - set_has_comment(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.comment) - return comment_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_comment(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.comment) + return comment_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string *OpProto::release_comment() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.comment) - clear_has_comment(); - return comment_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.comment) + clear_has_comment(); + return comment_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void OpProto::set_allocated_comment(::std::string *comment) { - if (comment != NULL) { - set_has_comment(); - } else { - clear_has_comment(); - } - comment_.SetAllocatedNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), comment); - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpProto.comment) + if (comment != NULL) { + set_has_comment(); + } else { + clear_has_comment(); + } + comment_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), comment); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpProto.comment) } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS - // =================================================================== + // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int VarType_TensorDesc::kDataTypeFieldNumber; @@ -4143,260 +4082,253 @@ const int VarType_TensorDesc::kDimsFieldNumber; VarType_TensorDesc::VarType_TensorDesc() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_framework_2eproto::InitDefaults(); - } - SharedCtor(); - // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarType.TensorDesc) + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + protobuf_framework_2eproto::InitDefaults(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarType.TensorDesc) } VarType_TensorDesc::VarType_TensorDesc(const VarType_TensorDesc &from) : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0), dims_(from.dims_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - data_type_ = from.data_type_; - // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.VarType.TensorDesc) + _internal_metadata_.MergeFrom(from._internal_metadata_); + data_type_ = from.data_type_; + // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.VarType.TensorDesc) } void VarType_TensorDesc::SharedCtor() { - _cached_size_ = 0; - data_type_ = 0; + _cached_size_ = 0; + data_type_ = 0; } VarType_TensorDesc::~VarType_TensorDesc() { - // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.VarType.TensorDesc) - SharedDtor(); + // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.VarType.TensorDesc) + SharedDtor(); } void VarType_TensorDesc::SharedDtor() {} void VarType_TensorDesc::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const VarType_TensorDesc &VarType_TensorDesc::default_instance() { - protobuf_framework_2eproto::InitDefaults(); - return *internal_default_instance(); + protobuf_framework_2eproto::InitDefaults(); + return *internal_default_instance(); } VarType_TensorDesc * VarType_TensorDesc::New(::google::protobuf::Arena *arena) const { - VarType_TensorDesc *n = new VarType_TensorDesc; - if (arena != NULL) { - arena->Own(n); - } - return n; + VarType_TensorDesc *n = new VarType_TensorDesc; + if (arena != NULL) { + arena->Own(n); + } + return n; } void VarType_TensorDesc::Clear() { - // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.VarType.TensorDesc) - ::google::protobuf::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void)cached_has_bits; + // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.VarType.TensorDesc) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; - dims_.Clear(); - data_type_ = 0; - _has_bits_.Clear(); - _internal_metadata_.Clear(); + dims_.Clear(); + data_type_ = 0; + _has_bits_.Clear(); + _internal_metadata_.Clear(); } bool VarType_TensorDesc::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::NewPermanentCallback( - &_internal_metadata_, - &::google::protobuf::internal::InternalMetadataWithArenaLite:: - mutable_unknown_fields)); - ::google::protobuf::io::CodedOutputStream unknown_fields_stream( - &unknown_fields_string, false); - // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.VarType.TensorDesc) - for (;;) { - ::std::pair<::google::protobuf::uint32, bool> p = - input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) - goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber( - tag)) { - // required .paddle_mobile.framework.proto.VarType.Type - // data_type = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { - int value; - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - int, ::google::protobuf::internal::WireFormatLite:: - TYPE_ENUM>(input, &value))); - if (::paddle_mobile::framework::proto::VarType_Type_IsValid( - value)) { - set_data_type( - static_cast< - ::paddle_mobile::framework::proto::VarType_Type>( - value)); - } else { - unknown_fields_stream.WriteVarint32(8u); - unknown_fields_stream.WriteVarint32( - static_cast<::google::protobuf::uint32>(value)); - } - } else { - goto handle_unusual; - } - break; - } - - // repeated int64 dims = 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { - DO_((::google::protobuf::internal::WireFormatLite:: - ReadRepeatedPrimitive<::google::protobuf::int64, - ::google::protobuf::internal:: - WireFormatLite::TYPE_INT64>( - 1, 16u, input, this->mutable_dims()))); - } else if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>( - 18u /* 18 & 0xFF */)) { - DO_((::google::protobuf::internal::WireFormatLite:: - ReadPackedPrimitiveNoInline< - ::google::protobuf::int64, - ::google::protobuf::internal::WireFormatLite:: - TYPE_INT64>(input, this->mutable_dims()))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } - } + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ + goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::NewPermanentCallback( + &_internal_metadata_, + &::google::protobuf::internal::InternalMetadataWithArenaLite:: + mutable_unknown_fields)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.VarType.TensorDesc) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = + input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) + goto handle_unusual; + switch ( + ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required .paddle_mobile.framework.proto.VarType.Type + // data_type = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::paddle_mobile::framework::proto::VarType_Type_IsValid(value)) { + set_data_type( + static_cast<::paddle_mobile::framework::proto::VarType_Type>( + value)); + } else { + unknown_fields_stream.WriteVarint32(8u); + unknown_fields_stream.WriteVarint32( + static_cast<::google::protobuf::uint32>(value)); + } + } else { + goto handle_unusual; + } + break; } + + // repeated int64 dims = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + DO_(( + ::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::int64, + ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + 1, 16u, input, this->mutable_dims()))); + } else if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite:: + ReadPackedPrimitiveNoInline< + ::google::protobuf::int64, + ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, this->mutable_dims()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } success: - // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.VarType.TensorDesc) - return true; + // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.VarType.TensorDesc) + return true; failure: - // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.VarType.TensorDesc) - return false; + // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.VarType.TensorDesc) + return false; #undef DO_ } void VarType_TensorDesc::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream *output) const { - // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.VarType.TensorDesc) - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _has_bits_[0]; - // required .paddle_mobile.framework.proto.VarType.Type - // data_type = 1; - if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormatLite::WriteEnum( - 1, this->data_type(), output); - } - - // repeated int64 dims = 2; - for (int i = 0, n = this->dims_size(); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteInt64( - 2, this->dims(i), output); - } - - output->WriteRaw( - _internal_metadata_.unknown_fields().data(), - static_cast(_internal_metadata_.unknown_fields().size())); - // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.VarType.TensorDesc) + // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.VarType.TensorDesc) + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required .paddle_mobile.framework.proto.VarType.Type + // data_type = 1; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->data_type(), output); + } + + // repeated int64 dims = 2; + for (int i = 0, n = this->dims_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->dims(i), + output); + } + + output->WriteRaw( + _internal_metadata_.unknown_fields().data(), + static_cast(_internal_metadata_.unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.VarType.TensorDesc) } size_t VarType_TensorDesc::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.VarType.TensorDesc) - size_t total_size = 0; - - total_size += _internal_metadata_.unknown_fields().size(); - - // required .paddle_mobile.framework.proto.VarType.Type - // data_type = 1; - if (has_data_type()) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::EnumSize( - this->data_type()); - } - // repeated int64 dims = 2; - { - size_t data_size = - ::google::protobuf::internal::WireFormatLite::Int64Size( - this->dims_); - total_size += - 1 * ::google::protobuf::internal::FromIntSize(this->dims_size()); - total_size += data_size; - } + // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.VarType.TensorDesc) + size_t total_size = 0; + + total_size += _internal_metadata_.unknown_fields().size(); + + // required .paddle_mobile.framework.proto.VarType.Type + // data_type = 1; + if (has_data_type()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize( + this->data_type()); + } + // repeated int64 dims = 2; + { + size_t data_size = + ::google::protobuf::internal::WireFormatLite::Int64Size(this->dims_); + total_size += + 1 * ::google::protobuf::internal::FromIntSize(this->dims_size()); + total_size += data_size; + } - int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; } void VarType_TensorDesc::CheckTypeAndMergeFrom( const ::google::protobuf::MessageLite &from) { - MergeFrom( - *::google::protobuf::down_cast(&from)); + MergeFrom(*::google::protobuf::down_cast(&from)); } void VarType_TensorDesc::MergeFrom(const VarType_TensorDesc &from) { - // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.VarType.TensorDesc) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; + // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.VarType.TensorDesc) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; - dims_.MergeFrom(from.dims_); - if (from.has_data_type()) { - set_data_type(from.data_type()); - } + dims_.MergeFrom(from.dims_); + if (from.has_data_type()) { + set_data_type(from.data_type()); + } } void VarType_TensorDesc::CopyFrom(const VarType_TensorDesc &from) { - // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType.TensorDesc) - if (&from == this) - return; - Clear(); - MergeFrom(from); + // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType.TensorDesc) + if (&from == this) + return; + Clear(); + MergeFrom(from); } bool VarType_TensorDesc::IsInitialized() const { - if ((_has_bits_[0] & 0x00000001) != 0x00000001) - return false; - return true; + if ((_has_bits_[0] & 0x00000001) != 0x00000001) + return false; + return true; } void VarType_TensorDesc::Swap(VarType_TensorDesc *other) { - if (other == this) - return; - InternalSwap(other); + if (other == this) + return; + InternalSwap(other); } void VarType_TensorDesc::InternalSwap(VarType_TensorDesc *other) { - using std::swap; - dims_.InternalSwap(&other->dims_); - swap(data_type_, other->data_type_); - swap(_has_bits_[0], other->_has_bits_[0]); - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); + using std::swap; + dims_.InternalSwap(&other->dims_); + swap(data_type_, other->data_type_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); } ::std::string VarType_TensorDesc::GetTypeName() const { - return "paddle_mobile.framework.proto.VarType.TensorDesc"; + return "paddle_mobile.framework.proto.VarType.TensorDesc"; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -4405,59 +4337,59 @@ void VarType_TensorDesc::InternalSwap(VarType_TensorDesc *other) { // required .paddle_mobile.framework.proto.VarType.Type data_type = // 1; bool VarType_TensorDesc::has_data_type() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } void VarType_TensorDesc::set_has_data_type() { _has_bits_[0] |= 0x00000001u; } void VarType_TensorDesc::clear_has_data_type() { - _has_bits_[0] &= ~0x00000001u; + _has_bits_[0] &= ~0x00000001u; } void VarType_TensorDesc::clear_data_type() { - data_type_ = 0; - clear_has_data_type(); + data_type_ = 0; + clear_has_data_type(); } ::paddle_mobile::framework::proto::VarType_Type VarType_TensorDesc::data_type() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.TensorDesc.data_type) - return static_cast<::paddle_mobile::framework::proto::VarType_Type>( - data_type_); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.TensorDesc.data_type) + return static_cast<::paddle_mobile::framework::proto::VarType_Type>( + data_type_); } void VarType_TensorDesc::set_data_type( ::paddle_mobile::framework::proto::VarType_Type value) { - assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); - set_has_data_type(); - data_type_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.TensorDesc.data_type) + assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); + set_has_data_type(); + data_type_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.TensorDesc.data_type) } // repeated int64 dims = 2; int VarType_TensorDesc::dims_size() const { return dims_.size(); } void VarType_TensorDesc::clear_dims() { dims_.Clear(); } ::google::protobuf::int64 VarType_TensorDesc::dims(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.TensorDesc.dims) - return dims_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.TensorDesc.dims) + return dims_.Get(index); } void VarType_TensorDesc::set_dims(int index, ::google::protobuf::int64 value) { - dims_.Set(index, value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.TensorDesc.dims) + dims_.Set(index, value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.TensorDesc.dims) } void VarType_TensorDesc::add_dims(::google::protobuf::int64 value) { - dims_.Add(value); - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.VarType.TensorDesc.dims) + dims_.Add(value); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.VarType.TensorDesc.dims) } const ::google::protobuf::RepeatedField<::google::protobuf::int64> & VarType_TensorDesc::dims() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.TensorDesc.dims) - return dims_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.TensorDesc.dims) + return dims_; } ::google::protobuf::RepeatedField<::google::protobuf::int64> * VarType_TensorDesc::mutable_dims() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.VarType.TensorDesc.dims) - return &dims_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.VarType.TensorDesc.dims) + return &dims_; } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS - // =================================================================== + // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int VarType_LoDTensorDesc::kTensorFieldNumber; @@ -4466,264 +4398,262 @@ const int VarType_LoDTensorDesc::kLodLevelFieldNumber; VarType_LoDTensorDesc::VarType_LoDTensorDesc() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_framework_2eproto::InitDefaults(); - } - SharedCtor(); - // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarType.LoDTensorDesc) + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + protobuf_framework_2eproto::InitDefaults(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarType.LoDTensorDesc) } VarType_LoDTensorDesc::VarType_LoDTensorDesc(const VarType_LoDTensorDesc &from) : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from.has_tensor()) { - tensor_ = new ::paddle_mobile::framework::proto::VarType_TensorDesc( - *from.tensor_); - } else { - tensor_ = NULL; - } - lod_level_ = from.lod_level_; - // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.VarType.LoDTensorDesc) + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_tensor()) { + tensor_ = new ::paddle_mobile::framework::proto::VarType_TensorDesc( + *from.tensor_); + } else { + tensor_ = NULL; + } + lod_level_ = from.lod_level_; + // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.VarType.LoDTensorDesc) } void VarType_LoDTensorDesc::SharedCtor() { - _cached_size_ = 0; - ::memset(&tensor_, 0, - static_cast(reinterpret_cast(&lod_level_) - - reinterpret_cast(&tensor_)) + - sizeof(lod_level_)); + _cached_size_ = 0; + ::memset(&tensor_, 0, + static_cast(reinterpret_cast(&lod_level_) - + reinterpret_cast(&tensor_)) + + sizeof(lod_level_)); } VarType_LoDTensorDesc::~VarType_LoDTensorDesc() { - // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.VarType.LoDTensorDesc) - SharedDtor(); + // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.VarType.LoDTensorDesc) + SharedDtor(); } void VarType_LoDTensorDesc::SharedDtor() { - if (this != internal_default_instance()) - delete tensor_; + if (this != internal_default_instance()) + delete tensor_; } void VarType_LoDTensorDesc::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const VarType_LoDTensorDesc &VarType_LoDTensorDesc::default_instance() { - protobuf_framework_2eproto::InitDefaults(); - return *internal_default_instance(); + protobuf_framework_2eproto::InitDefaults(); + return *internal_default_instance(); } VarType_LoDTensorDesc * VarType_LoDTensorDesc::New(::google::protobuf::Arena *arena) const { - VarType_LoDTensorDesc *n = new VarType_LoDTensorDesc; - if (arena != NULL) { - arena->Own(n); - } - return n; + VarType_LoDTensorDesc *n = new VarType_LoDTensorDesc; + if (arena != NULL) { + arena->Own(n); + } + return n; } void VarType_LoDTensorDesc::Clear() { - // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.VarType.LoDTensorDesc) - ::google::protobuf::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void)cached_has_bits; + // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.VarType.LoDTensorDesc) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; - if (has_tensor()) { - GOOGLE_DCHECK(tensor_ != NULL); - tensor_->::paddle_mobile::framework::proto::VarType_TensorDesc::Clear(); - } - lod_level_ = 0; - _has_bits_.Clear(); - _internal_metadata_.Clear(); + if (has_tensor()) { + GOOGLE_DCHECK(tensor_ != NULL); + tensor_->::paddle_mobile::framework::proto::VarType_TensorDesc::Clear(); + } + lod_level_ = 0; + _has_bits_.Clear(); + _internal_metadata_.Clear(); } bool VarType_LoDTensorDesc::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::NewPermanentCallback( - &_internal_metadata_, - &::google::protobuf::internal::InternalMetadataWithArenaLite:: - mutable_unknown_fields)); - ::google::protobuf::io::CodedOutputStream unknown_fields_stream( - &unknown_fields_string, false); - // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.VarType.LoDTensorDesc) - for (;;) { - ::std::pair<::google::protobuf::uint32, bool> p = - input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) - goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber( - tag)) { - // required - // .paddle_mobile.framework.proto.VarType.TensorDesc tensor - // = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite:: - ReadMessageNoVirtual(input, mutable_tensor())); - } else { - goto handle_unusual; - } - break; - } - - // optional int32 lod_level = 2 [default = 0]; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { - set_has_lod_level(); - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int32, - ::google::protobuf::internal::WireFormatLite:: - TYPE_INT32>(input, &lod_level_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } - } + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ + goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::NewPermanentCallback( + &_internal_metadata_, + &::google::protobuf::internal::InternalMetadataWithArenaLite:: + mutable_unknown_fields)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.VarType.LoDTensorDesc) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = + input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) + goto handle_unusual; + switch ( + ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required + // .paddle_mobile.framework.proto.VarType.TensorDesc tensor + // = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_tensor())); + } else { + goto handle_unusual; + } + break; } + + // optional int32 lod_level = 2 [default = 0]; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + set_has_lod_level(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, + ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &lod_level_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } success: - // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.VarType.LoDTensorDesc) - return true; + // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.VarType.LoDTensorDesc) + return true; failure: - // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.VarType.LoDTensorDesc) - return false; + // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.VarType.LoDTensorDesc) + return false; #undef DO_ } void VarType_LoDTensorDesc::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream *output) const { - // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.VarType.LoDTensorDesc) - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _has_bits_[0]; - // required .paddle_mobile.framework.proto.VarType.TensorDesc - // tensor = 1; - if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 1, *this->tensor_, output); - } - - // optional int32 lod_level = 2 [default = 0]; - if (cached_has_bits & 0x00000002u) { - ::google::protobuf::internal::WireFormatLite::WriteInt32( - 2, this->lod_level(), output); - } - - output->WriteRaw( - _internal_metadata_.unknown_fields().data(), - static_cast(_internal_metadata_.unknown_fields().size())); - // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.VarType.LoDTensorDesc) + // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.VarType.LoDTensorDesc) + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required .paddle_mobile.framework.proto.VarType.TensorDesc + // tensor = 1; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, *this->tensor_, output); + } + + // optional int32 lod_level = 2 [default = 0]; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormatLite::WriteInt32( + 2, this->lod_level(), output); + } + + output->WriteRaw( + _internal_metadata_.unknown_fields().data(), + static_cast(_internal_metadata_.unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.VarType.LoDTensorDesc) } size_t VarType_LoDTensorDesc::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.VarType.LoDTensorDesc) - size_t total_size = 0; + // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.VarType.LoDTensorDesc) + size_t total_size = 0; - total_size += _internal_metadata_.unknown_fields().size(); + total_size += _internal_metadata_.unknown_fields().size(); - // required .paddle_mobile.framework.proto.VarType.TensorDesc - // tensor = 1; - if (has_tensor()) { - total_size += - 1 + - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + // required .paddle_mobile.framework.proto.VarType.TensorDesc + // tensor = 1; + if (has_tensor()) { + total_size += + 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( *this->tensor_); - } - // optional int32 lod_level = 2 [default = 0]; - if (has_lod_level()) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( - this->lod_level()); - } + } + // optional int32 lod_level = 2 [default = 0]; + if (has_lod_level()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->lod_level()); + } - int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; } void VarType_LoDTensorDesc::CheckTypeAndMergeFrom( const ::google::protobuf::MessageLite &from) { - MergeFrom( - *::google::protobuf::down_cast(&from)); + MergeFrom( + *::google::protobuf::down_cast(&from)); } void VarType_LoDTensorDesc::MergeFrom(const VarType_LoDTensorDesc &from) { - // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.VarType.LoDTensorDesc) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = from._has_bits_[0]; - if (cached_has_bits & 3u) { - if (cached_has_bits & 0x00000001u) { - mutable_tensor()->::paddle_mobile::framework::proto:: - VarType_TensorDesc::MergeFrom(from.tensor()); - } - if (cached_has_bits & 0x00000002u) { - lod_level_ = from.lod_level_; - } - _has_bits_[0] |= cached_has_bits; + // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.VarType.LoDTensorDesc) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 3u) { + if (cached_has_bits & 0x00000001u) { + mutable_tensor() + ->::paddle_mobile::framework::proto::VarType_TensorDesc::MergeFrom( + from.tensor()); } + if (cached_has_bits & 0x00000002u) { + lod_level_ = from.lod_level_; + } + _has_bits_[0] |= cached_has_bits; + } } void VarType_LoDTensorDesc::CopyFrom(const VarType_LoDTensorDesc &from) { - // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType.LoDTensorDesc) - if (&from == this) - return; - Clear(); - MergeFrom(from); + // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType.LoDTensorDesc) + if (&from == this) + return; + Clear(); + MergeFrom(from); } bool VarType_LoDTensorDesc::IsInitialized() const { - if ((_has_bits_[0] & 0x00000001) != 0x00000001) - return false; - if (has_tensor()) { - if (!this->tensor_->IsInitialized()) - return false; - } - return true; + if ((_has_bits_[0] & 0x00000001) != 0x00000001) + return false; + if (has_tensor()) { + if (!this->tensor_->IsInitialized()) + return false; + } + return true; } void VarType_LoDTensorDesc::Swap(VarType_LoDTensorDesc *other) { - if (other == this) - return; - InternalSwap(other); + if (other == this) + return; + InternalSwap(other); } void VarType_LoDTensorDesc::InternalSwap(VarType_LoDTensorDesc *other) { - using std::swap; - swap(tensor_, other->tensor_); - swap(lod_level_, other->lod_level_); - swap(_has_bits_[0], other->_has_bits_[0]); - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); + using std::swap; + swap(tensor_, other->tensor_); + swap(lod_level_, other->lod_level_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); } ::std::string VarType_LoDTensorDesc::GetTypeName() const { - return "paddle_mobile.framework.proto.VarType.LoDTensorDesc"; + return "paddle_mobile.framework.proto.VarType.LoDTensorDesc"; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -4732,84 +4662,84 @@ void VarType_LoDTensorDesc::InternalSwap(VarType_LoDTensorDesc *other) { // required .paddle_mobile.framework.proto.VarType.TensorDesc tensor // = 1; bool VarType_LoDTensorDesc::has_tensor() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } void VarType_LoDTensorDesc::set_has_tensor() { _has_bits_[0] |= 0x00000001u; } void VarType_LoDTensorDesc::clear_has_tensor() { - _has_bits_[0] &= ~0x00000001u; + _has_bits_[0] &= ~0x00000001u; } void VarType_LoDTensorDesc::clear_tensor() { - if (tensor_ != NULL) - tensor_->::paddle_mobile::framework::proto::VarType_TensorDesc::Clear(); - clear_has_tensor(); + if (tensor_ != NULL) + tensor_->::paddle_mobile::framework::proto::VarType_TensorDesc::Clear(); + clear_has_tensor(); } const ::paddle_mobile::framework::proto::VarType_TensorDesc & VarType_LoDTensorDesc::tensor() const { - const ::paddle_mobile::framework::proto::VarType_TensorDesc *p = tensor_; - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorDesc.tensor) - return p != NULL - ? *p - : *reinterpret_cast< - const ::paddle_mobile::framework::proto::VarType_TensorDesc - *>(&::paddle_mobile::framework::proto:: - _VarType_TensorDesc_default_instance_); + const ::paddle_mobile::framework::proto::VarType_TensorDesc *p = tensor_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorDesc.tensor) + return p != NULL + ? *p + : *reinterpret_cast< + const ::paddle_mobile::framework::proto::VarType_TensorDesc + *>(&::paddle_mobile::framework::proto:: + _VarType_TensorDesc_default_instance_); } ::paddle_mobile::framework::proto::VarType_TensorDesc * VarType_LoDTensorDesc::mutable_tensor() { - set_has_tensor(); - if (tensor_ == NULL) { - tensor_ = new ::paddle_mobile::framework::proto::VarType_TensorDesc; - } - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.LoDTensorDesc.tensor) - return tensor_; + set_has_tensor(); + if (tensor_ == NULL) { + tensor_ = new ::paddle_mobile::framework::proto::VarType_TensorDesc; + } + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.LoDTensorDesc.tensor) + return tensor_; } ::paddle_mobile::framework::proto::VarType_TensorDesc * VarType_LoDTensorDesc::release_tensor() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.LoDTensorDesc.tensor) - clear_has_tensor(); - ::paddle_mobile::framework::proto::VarType_TensorDesc *temp = tensor_; - tensor_ = NULL; - return temp; + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.LoDTensorDesc.tensor) + clear_has_tensor(); + ::paddle_mobile::framework::proto::VarType_TensorDesc *temp = tensor_; + tensor_ = NULL; + return temp; } void VarType_LoDTensorDesc::set_allocated_tensor( ::paddle_mobile::framework::proto::VarType_TensorDesc *tensor) { - delete tensor_; - tensor_ = tensor; - if (tensor) { - set_has_tensor(); - } else { - clear_has_tensor(); - } - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.LoDTensorDesc.tensor) + delete tensor_; + tensor_ = tensor; + if (tensor) { + set_has_tensor(); + } else { + clear_has_tensor(); + } + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.LoDTensorDesc.tensor) } // optional int32 lod_level = 2 [default = 0]; bool VarType_LoDTensorDesc::has_lod_level() const { - return (_has_bits_[0] & 0x00000002u) != 0; + return (_has_bits_[0] & 0x00000002u) != 0; } void VarType_LoDTensorDesc::set_has_lod_level() { - _has_bits_[0] |= 0x00000002u; + _has_bits_[0] |= 0x00000002u; } void VarType_LoDTensorDesc::clear_has_lod_level() { - _has_bits_[0] &= ~0x00000002u; + _has_bits_[0] &= ~0x00000002u; } void VarType_LoDTensorDesc::clear_lod_level() { - lod_level_ = 0; - clear_has_lod_level(); + lod_level_ = 0; + clear_has_lod_level(); } ::google::protobuf::int32 VarType_LoDTensorDesc::lod_level() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorDesc.lod_level) - return lod_level_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorDesc.lod_level) + return lod_level_; } void VarType_LoDTensorDesc::set_lod_level(::google::protobuf::int32 value) { - set_has_lod_level(); - lod_level_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.LoDTensorDesc.lod_level) + set_has_lod_level(); + lod_level_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.LoDTensorDesc.lod_level) } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS - // =================================================================== + // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int VarType_LoDTensorArrayDesc::kTensorFieldNumber; @@ -4818,271 +4748,268 @@ const int VarType_LoDTensorArrayDesc::kLodLevelFieldNumber; VarType_LoDTensorArrayDesc::VarType_LoDTensorArrayDesc() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_framework_2eproto::InitDefaults(); - } - SharedCtor(); - // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + protobuf_framework_2eproto::InitDefaults(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) } VarType_LoDTensorArrayDesc::VarType_LoDTensorArrayDesc( const VarType_LoDTensorArrayDesc &from) : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from.has_tensor()) { - tensor_ = new ::paddle_mobile::framework::proto::VarType_TensorDesc( - *from.tensor_); - } else { - tensor_ = NULL; - } - lod_level_ = from.lod_level_; - // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_tensor()) { + tensor_ = new ::paddle_mobile::framework::proto::VarType_TensorDesc( + *from.tensor_); + } else { + tensor_ = NULL; + } + lod_level_ = from.lod_level_; + // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) } void VarType_LoDTensorArrayDesc::SharedCtor() { - _cached_size_ = 0; - ::memset(&tensor_, 0, - static_cast(reinterpret_cast(&lod_level_) - - reinterpret_cast(&tensor_)) + - sizeof(lod_level_)); + _cached_size_ = 0; + ::memset(&tensor_, 0, + static_cast(reinterpret_cast(&lod_level_) - + reinterpret_cast(&tensor_)) + + sizeof(lod_level_)); } VarType_LoDTensorArrayDesc::~VarType_LoDTensorArrayDesc() { - // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) - SharedDtor(); + // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) + SharedDtor(); } void VarType_LoDTensorArrayDesc::SharedDtor() { - if (this != internal_default_instance()) - delete tensor_; + if (this != internal_default_instance()) + delete tensor_; } void VarType_LoDTensorArrayDesc::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const VarType_LoDTensorArrayDesc & VarType_LoDTensorArrayDesc::default_instance() { - protobuf_framework_2eproto::InitDefaults(); - return *internal_default_instance(); + protobuf_framework_2eproto::InitDefaults(); + return *internal_default_instance(); } VarType_LoDTensorArrayDesc * VarType_LoDTensorArrayDesc::New(::google::protobuf::Arena *arena) const { - VarType_LoDTensorArrayDesc *n = new VarType_LoDTensorArrayDesc; - if (arena != NULL) { - arena->Own(n); - } - return n; + VarType_LoDTensorArrayDesc *n = new VarType_LoDTensorArrayDesc; + if (arena != NULL) { + arena->Own(n); + } + return n; } void VarType_LoDTensorArrayDesc::Clear() { - // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) - ::google::protobuf::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void)cached_has_bits; + // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; - if (has_tensor()) { - GOOGLE_DCHECK(tensor_ != NULL); - tensor_->::paddle_mobile::framework::proto::VarType_TensorDesc::Clear(); - } - lod_level_ = 0; - _has_bits_.Clear(); - _internal_metadata_.Clear(); + if (has_tensor()) { + GOOGLE_DCHECK(tensor_ != NULL); + tensor_->::paddle_mobile::framework::proto::VarType_TensorDesc::Clear(); + } + lod_level_ = 0; + _has_bits_.Clear(); + _internal_metadata_.Clear(); } bool VarType_LoDTensorArrayDesc::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::NewPermanentCallback( - &_internal_metadata_, - &::google::protobuf::internal::InternalMetadataWithArenaLite:: - mutable_unknown_fields)); - ::google::protobuf::io::CodedOutputStream unknown_fields_stream( - &unknown_fields_string, false); - // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) - for (;;) { - ::std::pair<::google::protobuf::uint32, bool> p = - input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) - goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber( - tag)) { - // required - // .paddle_mobile.framework.proto.VarType.TensorDesc tensor - // = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite:: - ReadMessageNoVirtual(input, mutable_tensor())); - } else { - goto handle_unusual; - } - break; - } - - // optional int32 lod_level = 2 [default = 0]; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { - set_has_lod_level(); - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int32, - ::google::protobuf::internal::WireFormatLite:: - TYPE_INT32>(input, &lod_level_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } - } + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ + goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::NewPermanentCallback( + &_internal_metadata_, + &::google::protobuf::internal::InternalMetadataWithArenaLite:: + mutable_unknown_fields)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = + input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) + goto handle_unusual; + switch ( + ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required + // .paddle_mobile.framework.proto.VarType.TensorDesc tensor + // = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_tensor())); + } else { + goto handle_unusual; + } + break; } + + // optional int32 lod_level = 2 [default = 0]; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + set_has_lod_level(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, + ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &lod_level_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } success: - // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) - return true; + // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) + return true; failure: - // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) - return false; + // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) + return false; #undef DO_ } void VarType_LoDTensorArrayDesc::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream *output) const { - // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _has_bits_[0]; - // required .paddle_mobile.framework.proto.VarType.TensorDesc - // tensor = 1; - if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 1, *this->tensor_, output); - } - - // optional int32 lod_level = 2 [default = 0]; - if (cached_has_bits & 0x00000002u) { - ::google::protobuf::internal::WireFormatLite::WriteInt32( - 2, this->lod_level(), output); - } - - output->WriteRaw( - _internal_metadata_.unknown_fields().data(), - static_cast(_internal_metadata_.unknown_fields().size())); - // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) + // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required .paddle_mobile.framework.proto.VarType.TensorDesc + // tensor = 1; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, *this->tensor_, output); + } + + // optional int32 lod_level = 2 [default = 0]; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormatLite::WriteInt32( + 2, this->lod_level(), output); + } + + output->WriteRaw( + _internal_metadata_.unknown_fields().data(), + static_cast(_internal_metadata_.unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) } size_t VarType_LoDTensorArrayDesc::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) - size_t total_size = 0; + // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) + size_t total_size = 0; - total_size += _internal_metadata_.unknown_fields().size(); + total_size += _internal_metadata_.unknown_fields().size(); - // required .paddle_mobile.framework.proto.VarType.TensorDesc - // tensor = 1; - if (has_tensor()) { - total_size += - 1 + - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + // required .paddle_mobile.framework.proto.VarType.TensorDesc + // tensor = 1; + if (has_tensor()) { + total_size += + 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( *this->tensor_); - } - // optional int32 lod_level = 2 [default = 0]; - if (has_lod_level()) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( - this->lod_level()); - } + } + // optional int32 lod_level = 2 [default = 0]; + if (has_lod_level()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->lod_level()); + } - int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; } void VarType_LoDTensorArrayDesc::CheckTypeAndMergeFrom( const ::google::protobuf::MessageLite &from) { - MergeFrom( - *::google::protobuf::down_cast( - &from)); + MergeFrom(*::google::protobuf::down_cast( + &from)); } void VarType_LoDTensorArrayDesc::MergeFrom( const VarType_LoDTensorArrayDesc &from) { - // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = from._has_bits_[0]; - if (cached_has_bits & 3u) { - if (cached_has_bits & 0x00000001u) { - mutable_tensor()->::paddle_mobile::framework::proto:: - VarType_TensorDesc::MergeFrom(from.tensor()); - } - if (cached_has_bits & 0x00000002u) { - lod_level_ = from.lod_level_; - } - _has_bits_[0] |= cached_has_bits; + // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 3u) { + if (cached_has_bits & 0x00000001u) { + mutable_tensor() + ->::paddle_mobile::framework::proto::VarType_TensorDesc::MergeFrom( + from.tensor()); + } + if (cached_has_bits & 0x00000002u) { + lod_level_ = from.lod_level_; } + _has_bits_[0] |= cached_has_bits; + } } void VarType_LoDTensorArrayDesc::CopyFrom( const VarType_LoDTensorArrayDesc &from) { - // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) - if (&from == this) - return; - Clear(); - MergeFrom(from); + // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) + if (&from == this) + return; + Clear(); + MergeFrom(from); } bool VarType_LoDTensorArrayDesc::IsInitialized() const { - if ((_has_bits_[0] & 0x00000001) != 0x00000001) - return false; - if (has_tensor()) { - if (!this->tensor_->IsInitialized()) - return false; - } - return true; + if ((_has_bits_[0] & 0x00000001) != 0x00000001) + return false; + if (has_tensor()) { + if (!this->tensor_->IsInitialized()) + return false; + } + return true; } void VarType_LoDTensorArrayDesc::Swap(VarType_LoDTensorArrayDesc *other) { - if (other == this) - return; - InternalSwap(other); + if (other == this) + return; + InternalSwap(other); } void VarType_LoDTensorArrayDesc::InternalSwap( VarType_LoDTensorArrayDesc *other) { - using std::swap; - swap(tensor_, other->tensor_); - swap(lod_level_, other->lod_level_); - swap(_has_bits_[0], other->_has_bits_[0]); - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); + using std::swap; + swap(tensor_, other->tensor_); + swap(lod_level_, other->lod_level_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); } ::std::string VarType_LoDTensorArrayDesc::GetTypeName() const { - return "paddle_mobile.framework.proto.VarType." - "LoDTensorArrayDesc"; + return "paddle_mobile.framework.proto.VarType." + "LoDTensorArrayDesc"; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -5091,87 +5018,87 @@ void VarType_LoDTensorArrayDesc::InternalSwap( // required .paddle_mobile.framework.proto.VarType.TensorDesc tensor // = 1; bool VarType_LoDTensorArrayDesc::has_tensor() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } void VarType_LoDTensorArrayDesc::set_has_tensor() { - _has_bits_[0] |= 0x00000001u; + _has_bits_[0] |= 0x00000001u; } void VarType_LoDTensorArrayDesc::clear_has_tensor() { - _has_bits_[0] &= ~0x00000001u; + _has_bits_[0] &= ~0x00000001u; } void VarType_LoDTensorArrayDesc::clear_tensor() { - if (tensor_ != NULL) - tensor_->::paddle_mobile::framework::proto::VarType_TensorDesc::Clear(); - clear_has_tensor(); + if (tensor_ != NULL) + tensor_->::paddle_mobile::framework::proto::VarType_TensorDesc::Clear(); + clear_has_tensor(); } const ::paddle_mobile::framework::proto::VarType_TensorDesc & VarType_LoDTensorArrayDesc::tensor() const { - const ::paddle_mobile::framework::proto::VarType_TensorDesc *p = tensor_; - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.tensor) - return p != NULL - ? *p - : *reinterpret_cast< - const ::paddle_mobile::framework::proto::VarType_TensorDesc - *>(&::paddle_mobile::framework::proto:: - _VarType_TensorDesc_default_instance_); + const ::paddle_mobile::framework::proto::VarType_TensorDesc *p = tensor_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.tensor) + return p != NULL + ? *p + : *reinterpret_cast< + const ::paddle_mobile::framework::proto::VarType_TensorDesc + *>(&::paddle_mobile::framework::proto:: + _VarType_TensorDesc_default_instance_); } ::paddle_mobile::framework::proto::VarType_TensorDesc * VarType_LoDTensorArrayDesc::mutable_tensor() { - set_has_tensor(); - if (tensor_ == NULL) { - tensor_ = new ::paddle_mobile::framework::proto::VarType_TensorDesc; - } - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.tensor) - return tensor_; + set_has_tensor(); + if (tensor_ == NULL) { + tensor_ = new ::paddle_mobile::framework::proto::VarType_TensorDesc; + } + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.tensor) + return tensor_; } ::paddle_mobile::framework::proto::VarType_TensorDesc * VarType_LoDTensorArrayDesc::release_tensor() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.tensor) - clear_has_tensor(); - ::paddle_mobile::framework::proto::VarType_TensorDesc *temp = tensor_; - tensor_ = NULL; - return temp; + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.tensor) + clear_has_tensor(); + ::paddle_mobile::framework::proto::VarType_TensorDesc *temp = tensor_; + tensor_ = NULL; + return temp; } void VarType_LoDTensorArrayDesc::set_allocated_tensor( ::paddle_mobile::framework::proto::VarType_TensorDesc *tensor) { - delete tensor_; - tensor_ = tensor; - if (tensor) { - set_has_tensor(); - } else { - clear_has_tensor(); - } - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.tensor) + delete tensor_; + tensor_ = tensor; + if (tensor) { + set_has_tensor(); + } else { + clear_has_tensor(); + } + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.tensor) } // optional int32 lod_level = 2 [default = 0]; bool VarType_LoDTensorArrayDesc::has_lod_level() const { - return (_has_bits_[0] & 0x00000002u) != 0; + return (_has_bits_[0] & 0x00000002u) != 0; } void VarType_LoDTensorArrayDesc::set_has_lod_level() { - _has_bits_[0] |= 0x00000002u; + _has_bits_[0] |= 0x00000002u; } void VarType_LoDTensorArrayDesc::clear_has_lod_level() { - _has_bits_[0] &= ~0x00000002u; + _has_bits_[0] &= ~0x00000002u; } void VarType_LoDTensorArrayDesc::clear_lod_level() { - lod_level_ = 0; - clear_has_lod_level(); + lod_level_ = 0; + clear_has_lod_level(); } ::google::protobuf::int32 VarType_LoDTensorArrayDesc::lod_level() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.lod_level) - return lod_level_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.lod_level) + return lod_level_; } void VarType_LoDTensorArrayDesc::set_lod_level( ::google::protobuf::int32 value) { - set_has_lod_level(); - lod_level_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.lod_level) + set_has_lod_level(); + lod_level_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.lod_level) } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS - // =================================================================== + // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int VarType_ReaderDesc::kLodTensorFieldNumber; @@ -5179,207 +5106,207 @@ const int VarType_ReaderDesc::kLodTensorFieldNumber; VarType_ReaderDesc::VarType_ReaderDesc() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_framework_2eproto::InitDefaults(); - } - SharedCtor(); - // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarType.ReaderDesc) + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + protobuf_framework_2eproto::InitDefaults(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarType.ReaderDesc) } VarType_ReaderDesc::VarType_ReaderDesc(const VarType_ReaderDesc &from) : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0), lod_tensor_(from.lod_tensor_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.VarType.ReaderDesc) + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.VarType.ReaderDesc) } void VarType_ReaderDesc::SharedCtor() { _cached_size_ = 0; } VarType_ReaderDesc::~VarType_ReaderDesc() { - // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.VarType.ReaderDesc) - SharedDtor(); + // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.VarType.ReaderDesc) + SharedDtor(); } void VarType_ReaderDesc::SharedDtor() {} void VarType_ReaderDesc::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const VarType_ReaderDesc &VarType_ReaderDesc::default_instance() { - protobuf_framework_2eproto::InitDefaults(); - return *internal_default_instance(); + protobuf_framework_2eproto::InitDefaults(); + return *internal_default_instance(); } VarType_ReaderDesc * VarType_ReaderDesc::New(::google::protobuf::Arena *arena) const { - VarType_ReaderDesc *n = new VarType_ReaderDesc; - if (arena != NULL) { - arena->Own(n); - } - return n; + VarType_ReaderDesc *n = new VarType_ReaderDesc; + if (arena != NULL) { + arena->Own(n); + } + return n; } void VarType_ReaderDesc::Clear() { - // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.VarType.ReaderDesc) - ::google::protobuf::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void)cached_has_bits; + // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.VarType.ReaderDesc) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; - lod_tensor_.Clear(); - _has_bits_.Clear(); - _internal_metadata_.Clear(); + lod_tensor_.Clear(); + _has_bits_.Clear(); + _internal_metadata_.Clear(); } bool VarType_ReaderDesc::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::NewPermanentCallback( - &_internal_metadata_, - &::google::protobuf::internal::InternalMetadataWithArenaLite:: - mutable_unknown_fields)); - ::google::protobuf::io::CodedOutputStream unknown_fields_stream( - &unknown_fields_string, false); - // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.VarType.ReaderDesc) - for (;;) { - ::std::pair<::google::protobuf::uint32, bool> p = - input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) - goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber( - tag)) { - // repeated - // .paddle_mobile.framework.proto.VarType.LoDTensorDesc - // lod_tensor = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite:: - ReadMessageNoVirtual(input, add_lod_tensor())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } - } - } + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ + goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::NewPermanentCallback( + &_internal_metadata_, + &::google::protobuf::internal::InternalMetadataWithArenaLite:: + mutable_unknown_fields)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.VarType.ReaderDesc) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = + input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) + goto handle_unusual; + switch ( + ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated + // .paddle_mobile.framework.proto.VarType.LoDTensorDesc + // lod_tensor = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_lod_tensor())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } success: - // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.VarType.ReaderDesc) - return true; + // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.VarType.ReaderDesc) + return true; failure: - // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.VarType.ReaderDesc) - return false; + // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.VarType.ReaderDesc) + return false; #undef DO_ } void VarType_ReaderDesc::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream *output) const { - // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.VarType.ReaderDesc) - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - // repeated .paddle_mobile.framework.proto.VarType.LoDTensorDesc - // lod_tensor = - // 1; - for (unsigned int i = 0, - n = static_cast(this->lod_tensor_size()); - i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 1, this->lod_tensor(static_cast(i)), output); - } - - output->WriteRaw( - _internal_metadata_.unknown_fields().data(), - static_cast(_internal_metadata_.unknown_fields().size())); - // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.VarType.ReaderDesc) + // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.VarType.ReaderDesc) + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + // repeated .paddle_mobile.framework.proto.VarType.LoDTensorDesc + // lod_tensor = + // 1; + for (unsigned int i = 0, + n = static_cast(this->lod_tensor_size()); + i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, this->lod_tensor(static_cast(i)), output); + } + + output->WriteRaw( + _internal_metadata_.unknown_fields().data(), + static_cast(_internal_metadata_.unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.VarType.ReaderDesc) } size_t VarType_ReaderDesc::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.VarType.ReaderDesc) - size_t total_size = 0; - - total_size += _internal_metadata_.unknown_fields().size(); - - // repeated .paddle_mobile.framework.proto.VarType.LoDTensorDesc - // lod_tensor = - // 1; - { - unsigned int count = static_cast(this->lod_tensor_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += ::google::protobuf::internal::WireFormatLite:: - MessageSizeNoVirtual(this->lod_tensor(static_cast(i))); - } + // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.VarType.ReaderDesc) + size_t total_size = 0; + + total_size += _internal_metadata_.unknown_fields().size(); + + // repeated .paddle_mobile.framework.proto.VarType.LoDTensorDesc + // lod_tensor = + // 1; + { + unsigned int count = static_cast(this->lod_tensor_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->lod_tensor(static_cast(i))); } + } - int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; } void VarType_ReaderDesc::CheckTypeAndMergeFrom( const ::google::protobuf::MessageLite &from) { - MergeFrom( - *::google::protobuf::down_cast(&from)); + MergeFrom(*::google::protobuf::down_cast(&from)); } void VarType_ReaderDesc::MergeFrom(const VarType_ReaderDesc &from) { - // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.VarType.ReaderDesc) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; + // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.VarType.ReaderDesc) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; - lod_tensor_.MergeFrom(from.lod_tensor_); + lod_tensor_.MergeFrom(from.lod_tensor_); } void VarType_ReaderDesc::CopyFrom(const VarType_ReaderDesc &from) { - // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType.ReaderDesc) - if (&from == this) - return; - Clear(); - MergeFrom(from); + // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType.ReaderDesc) + if (&from == this) + return; + Clear(); + MergeFrom(from); } bool VarType_ReaderDesc::IsInitialized() const { - if (!::google::protobuf::internal::AllAreInitialized(this->lod_tensor())) - return false; - return true; + if (!::google::protobuf::internal::AllAreInitialized(this->lod_tensor())) + return false; + return true; } void VarType_ReaderDesc::Swap(VarType_ReaderDesc *other) { - if (other == this) - return; - InternalSwap(other); + if (other == this) + return; + InternalSwap(other); } void VarType_ReaderDesc::InternalSwap(VarType_ReaderDesc *other) { - using std::swap; - lod_tensor_.InternalSwap(&other->lod_tensor_); - swap(_has_bits_[0], other->_has_bits_[0]); - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); + using std::swap; + lod_tensor_.InternalSwap(&other->lod_tensor_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); } ::std::string VarType_ReaderDesc::GetTypeName() const { - return "paddle_mobile.framework.proto.VarType.ReaderDesc"; + return "paddle_mobile.framework.proto.VarType.ReaderDesc"; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -5391,35 +5318,35 @@ int VarType_ReaderDesc::lod_tensor_size() const { return lod_tensor_.size(); } void VarType_ReaderDesc::clear_lod_tensor() { lod_tensor_.Clear(); } const ::paddle_mobile::framework::proto::VarType_LoDTensorDesc & VarType_ReaderDesc::lod_tensor(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) - return lod_tensor_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) + return lod_tensor_.Get(index); } ::paddle_mobile::framework::proto::VarType_LoDTensorDesc * VarType_ReaderDesc::mutable_lod_tensor(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) - return lod_tensor_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) + return lod_tensor_.Mutable(index); } ::paddle_mobile::framework::proto::VarType_LoDTensorDesc * VarType_ReaderDesc::add_lod_tensor() { - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) - return lod_tensor_.Add(); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) + return lod_tensor_.Add(); } ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> * VarType_ReaderDesc::mutable_lod_tensor() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) - return &lod_tensor_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) + return &lod_tensor_; } const ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> & VarType_ReaderDesc::lod_tensor() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) - return lod_tensor_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) + return lod_tensor_; } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS - // =================================================================== + // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int VarType_ChannelDesc::kDataTypeFieldNumber; @@ -5428,290 +5355,281 @@ const int VarType_ChannelDesc::kCapacityFieldNumber; VarType_ChannelDesc::VarType_ChannelDesc() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_framework_2eproto::InitDefaults(); - } - SharedCtor(); - // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarType.ChannelDesc) + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + protobuf_framework_2eproto::InitDefaults(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarType.ChannelDesc) } VarType_ChannelDesc::VarType_ChannelDesc(const VarType_ChannelDesc &from) : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::memcpy(&capacity_, &from.capacity_, - static_cast(reinterpret_cast(&data_type_) - - reinterpret_cast(&capacity_)) + - sizeof(data_type_)); - // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.VarType.ChannelDesc) + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&capacity_, &from.capacity_, + static_cast(reinterpret_cast(&data_type_) - + reinterpret_cast(&capacity_)) + + sizeof(data_type_)); + // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.VarType.ChannelDesc) } void VarType_ChannelDesc::SharedCtor() { - _cached_size_ = 0; - ::memset(&capacity_, 0, - static_cast(reinterpret_cast(&data_type_) - - reinterpret_cast(&capacity_)) + - sizeof(data_type_)); + _cached_size_ = 0; + ::memset(&capacity_, 0, + static_cast(reinterpret_cast(&data_type_) - + reinterpret_cast(&capacity_)) + + sizeof(data_type_)); } VarType_ChannelDesc::~VarType_ChannelDesc() { - // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.VarType.ChannelDesc) - SharedDtor(); + // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.VarType.ChannelDesc) + SharedDtor(); } void VarType_ChannelDesc::SharedDtor() {} void VarType_ChannelDesc::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const VarType_ChannelDesc &VarType_ChannelDesc::default_instance() { - protobuf_framework_2eproto::InitDefaults(); - return *internal_default_instance(); + protobuf_framework_2eproto::InitDefaults(); + return *internal_default_instance(); } VarType_ChannelDesc * VarType_ChannelDesc::New(::google::protobuf::Arena *arena) const { - VarType_ChannelDesc *n = new VarType_ChannelDesc; - if (arena != NULL) { - arena->Own(n); - } - return n; + VarType_ChannelDesc *n = new VarType_ChannelDesc; + if (arena != NULL) { + arena->Own(n); + } + return n; } void VarType_ChannelDesc::Clear() { - // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.VarType.ChannelDesc) - ::google::protobuf::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void)cached_has_bits; + // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.VarType.ChannelDesc) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 3u) { - ::memset(&capacity_, 0, - static_cast(reinterpret_cast(&data_type_) - - reinterpret_cast(&capacity_)) + - sizeof(data_type_)); - } - _has_bits_.Clear(); - _internal_metadata_.Clear(); + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 3u) { + ::memset(&capacity_, 0, + static_cast(reinterpret_cast(&data_type_) - + reinterpret_cast(&capacity_)) + + sizeof(data_type_)); + } + _has_bits_.Clear(); + _internal_metadata_.Clear(); } bool VarType_ChannelDesc::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::NewPermanentCallback( - &_internal_metadata_, - &::google::protobuf::internal::InternalMetadataWithArenaLite:: - mutable_unknown_fields)); - ::google::protobuf::io::CodedOutputStream unknown_fields_stream( - &unknown_fields_string, false); - // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.VarType.ChannelDesc) - for (;;) { - ::std::pair<::google::protobuf::uint32, bool> p = - input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) - goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber( - tag)) { - // required .paddle_mobile.framework.proto.VarType.Type - // data_type = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { - int value; - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - int, ::google::protobuf::internal::WireFormatLite:: - TYPE_ENUM>(input, &value))); - if (::paddle_mobile::framework::proto::VarType_Type_IsValid( - value)) { - set_data_type( - static_cast< - ::paddle_mobile::framework::proto::VarType_Type>( - value)); - } else { - unknown_fields_stream.WriteVarint32(8u); - unknown_fields_stream.WriteVarint32( - static_cast<::google::protobuf::uint32>(value)); - } - } else { - goto handle_unusual; - } - break; - } - - // required int64 capacity = 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { - set_has_capacity(); - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int64, - ::google::protobuf::internal::WireFormatLite:: - TYPE_INT64>(input, &capacity_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } - } + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ + goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::NewPermanentCallback( + &_internal_metadata_, + &::google::protobuf::internal::InternalMetadataWithArenaLite:: + mutable_unknown_fields)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.VarType.ChannelDesc) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = + input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) + goto handle_unusual; + switch ( + ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required .paddle_mobile.framework.proto.VarType.Type + // data_type = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::paddle_mobile::framework::proto::VarType_Type_IsValid(value)) { + set_data_type( + static_cast<::paddle_mobile::framework::proto::VarType_Type>( + value)); + } else { + unknown_fields_stream.WriteVarint32(8u); + unknown_fields_stream.WriteVarint32( + static_cast<::google::protobuf::uint32>(value)); + } + } else { + goto handle_unusual; + } + break; } + + // required int64 capacity = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + set_has_capacity(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, + ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &capacity_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } success: - // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.VarType.ChannelDesc) - return true; + // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.VarType.ChannelDesc) + return true; failure: - // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.VarType.ChannelDesc) - return false; + // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.VarType.ChannelDesc) + return false; #undef DO_ } void VarType_ChannelDesc::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream *output) const { - // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.VarType.ChannelDesc) - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _has_bits_[0]; - // required .paddle_mobile.framework.proto.VarType.Type - // data_type = 1; - if (cached_has_bits & 0x00000002u) { - ::google::protobuf::internal::WireFormatLite::WriteEnum( - 1, this->data_type(), output); - } - - // required int64 capacity = 2; - if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormatLite::WriteInt64( - 2, this->capacity(), output); - } - - output->WriteRaw( - _internal_metadata_.unknown_fields().data(), - static_cast(_internal_metadata_.unknown_fields().size())); - // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.VarType.ChannelDesc) + // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.VarType.ChannelDesc) + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required .paddle_mobile.framework.proto.VarType.Type + // data_type = 1; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->data_type(), output); + } + + // required int64 capacity = 2; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormatLite::WriteInt64( + 2, this->capacity(), output); + } + + output->WriteRaw( + _internal_metadata_.unknown_fields().data(), + static_cast(_internal_metadata_.unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.VarType.ChannelDesc) } size_t VarType_ChannelDesc::RequiredFieldsByteSizeFallback() const { - // @@protoc_insertion_point(required_fields_byte_size_fallback_start:paddle_mobile.framework.proto.VarType.ChannelDesc) - size_t total_size = 0; + // @@protoc_insertion_point(required_fields_byte_size_fallback_start:paddle_mobile.framework.proto.VarType.ChannelDesc) + size_t total_size = 0; - if (has_capacity()) { - // required int64 capacity = 2; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::Int64Size( - this->capacity()); - } + if (has_capacity()) { + // required int64 capacity = 2; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->capacity()); + } - if (has_data_type()) { - // required .paddle_mobile.framework.proto.VarType.Type - // data_type = 1; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::EnumSize( - this->data_type()); - } + if (has_data_type()) { + // required .paddle_mobile.framework.proto.VarType.Type + // data_type = 1; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize( + this->data_type()); + } - return total_size; + return total_size; } size_t VarType_ChannelDesc::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.VarType.ChannelDesc) - size_t total_size = 0; + // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.VarType.ChannelDesc) + size_t total_size = 0; - total_size += _internal_metadata_.unknown_fields().size(); + total_size += _internal_metadata_.unknown_fields().size(); - if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == - 0) { // All required fields are present. - // required int64 capacity = 2; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::Int64Size( - this->capacity()); + if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == + 0) { // All required fields are present. + // required int64 capacity = 2; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->capacity()); - // required .paddle_mobile.framework.proto.VarType.Type - // data_type = 1; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::EnumSize( - this->data_type()); + // required .paddle_mobile.framework.proto.VarType.Type + // data_type = 1; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize( + this->data_type()); - } else { - total_size += RequiredFieldsByteSizeFallback(); - } - int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; + } else { + total_size += RequiredFieldsByteSizeFallback(); + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; } void VarType_ChannelDesc::CheckTypeAndMergeFrom( const ::google::protobuf::MessageLite &from) { - MergeFrom( - *::google::protobuf::down_cast(&from)); + MergeFrom(*::google::protobuf::down_cast(&from)); } void VarType_ChannelDesc::MergeFrom(const VarType_ChannelDesc &from) { - // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.VarType.ChannelDesc) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = from._has_bits_[0]; - if (cached_has_bits & 3u) { - if (cached_has_bits & 0x00000001u) { - capacity_ = from.capacity_; - } - if (cached_has_bits & 0x00000002u) { - data_type_ = from.data_type_; - } - _has_bits_[0] |= cached_has_bits; + // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.VarType.ChannelDesc) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 3u) { + if (cached_has_bits & 0x00000001u) { + capacity_ = from.capacity_; } + if (cached_has_bits & 0x00000002u) { + data_type_ = from.data_type_; + } + _has_bits_[0] |= cached_has_bits; + } } void VarType_ChannelDesc::CopyFrom(const VarType_ChannelDesc &from) { - // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType.ChannelDesc) - if (&from == this) - return; - Clear(); - MergeFrom(from); + // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType.ChannelDesc) + if (&from == this) + return; + Clear(); + MergeFrom(from); } bool VarType_ChannelDesc::IsInitialized() const { - if ((_has_bits_[0] & 0x00000003) != 0x00000003) - return false; - return true; + if ((_has_bits_[0] & 0x00000003) != 0x00000003) + return false; + return true; } void VarType_ChannelDesc::Swap(VarType_ChannelDesc *other) { - if (other == this) - return; - InternalSwap(other); + if (other == this) + return; + InternalSwap(other); } void VarType_ChannelDesc::InternalSwap(VarType_ChannelDesc *other) { - using std::swap; - swap(capacity_, other->capacity_); - swap(data_type_, other->data_type_); - swap(_has_bits_[0], other->_has_bits_[0]); - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); + using std::swap; + swap(capacity_, other->capacity_); + swap(data_type_, other->data_type_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); } ::std::string VarType_ChannelDesc::GetTypeName() const { - return "paddle_mobile.framework.proto.VarType.ChannelDesc"; + return "paddle_mobile.framework.proto.VarType.ChannelDesc"; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -5720,55 +5638,55 @@ void VarType_ChannelDesc::InternalSwap(VarType_ChannelDesc *other) { // required .paddle_mobile.framework.proto.VarType.Type data_type = // 1; bool VarType_ChannelDesc::has_data_type() const { - return (_has_bits_[0] & 0x00000002u) != 0; + return (_has_bits_[0] & 0x00000002u) != 0; } void VarType_ChannelDesc::set_has_data_type() { _has_bits_[0] |= 0x00000002u; } void VarType_ChannelDesc::clear_has_data_type() { - _has_bits_[0] &= ~0x00000002u; + _has_bits_[0] &= ~0x00000002u; } void VarType_ChannelDesc::clear_data_type() { - data_type_ = 0; - clear_has_data_type(); + data_type_ = 0; + clear_has_data_type(); } ::paddle_mobile::framework::proto::VarType_Type VarType_ChannelDesc::data_type() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.ChannelDesc.data_type) - return static_cast<::paddle_mobile::framework::proto::VarType_Type>( - data_type_); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.ChannelDesc.data_type) + return static_cast<::paddle_mobile::framework::proto::VarType_Type>( + data_type_); } void VarType_ChannelDesc::set_data_type( ::paddle_mobile::framework::proto::VarType_Type value) { - assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); - set_has_data_type(); - data_type_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.ChannelDesc.data_type) + assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); + set_has_data_type(); + data_type_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.ChannelDesc.data_type) } // required int64 capacity = 2; bool VarType_ChannelDesc::has_capacity() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } void VarType_ChannelDesc::set_has_capacity() { _has_bits_[0] |= 0x00000001u; } void VarType_ChannelDesc::clear_has_capacity() { - _has_bits_[0] &= ~0x00000001u; + _has_bits_[0] &= ~0x00000001u; } void VarType_ChannelDesc::clear_capacity() { - capacity_ = GOOGLE_LONGLONG(0); - clear_has_capacity(); + capacity_ = GOOGLE_LONGLONG(0); + clear_has_capacity(); } ::google::protobuf::int64 VarType_ChannelDesc::capacity() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.ChannelDesc.capacity) - return capacity_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.ChannelDesc.capacity) + return capacity_; } void VarType_ChannelDesc::set_capacity(::google::protobuf::int64 value) { - set_has_capacity(); - capacity_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.ChannelDesc.capacity) + set_has_capacity(); + capacity_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.ChannelDesc.capacity) } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS - // =================================================================== + // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int VarType_Tuple::kElementTypeFieldNumber; @@ -5776,222 +5694,215 @@ const int VarType_Tuple::kElementTypeFieldNumber; VarType_Tuple::VarType_Tuple() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_framework_2eproto::InitDefaults(); - } - SharedCtor(); - // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarType.Tuple) + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + protobuf_framework_2eproto::InitDefaults(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarType.Tuple) } VarType_Tuple::VarType_Tuple(const VarType_Tuple &from) : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0), element_type_(from.element_type_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.VarType.Tuple) + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.VarType.Tuple) } void VarType_Tuple::SharedCtor() { _cached_size_ = 0; } VarType_Tuple::~VarType_Tuple() { - // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.VarType.Tuple) - SharedDtor(); + // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.VarType.Tuple) + SharedDtor(); } void VarType_Tuple::SharedDtor() {} void VarType_Tuple::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const VarType_Tuple &VarType_Tuple::default_instance() { - protobuf_framework_2eproto::InitDefaults(); - return *internal_default_instance(); + protobuf_framework_2eproto::InitDefaults(); + return *internal_default_instance(); } VarType_Tuple *VarType_Tuple::New(::google::protobuf::Arena *arena) const { - VarType_Tuple *n = new VarType_Tuple; - if (arena != NULL) { - arena->Own(n); - } - return n; + VarType_Tuple *n = new VarType_Tuple; + if (arena != NULL) { + arena->Own(n); + } + return n; } void VarType_Tuple::Clear() { - // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.VarType.Tuple) - ::google::protobuf::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void)cached_has_bits; + // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.VarType.Tuple) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; - element_type_.Clear(); - _has_bits_.Clear(); - _internal_metadata_.Clear(); + element_type_.Clear(); + _has_bits_.Clear(); + _internal_metadata_.Clear(); } bool VarType_Tuple::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::NewPermanentCallback( - &_internal_metadata_, - &::google::protobuf::internal::InternalMetadataWithArenaLite:: - mutable_unknown_fields)); - ::google::protobuf::io::CodedOutputStream unknown_fields_stream( - &unknown_fields_string, false); - // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.VarType.Tuple) - for (;;) { - ::std::pair<::google::protobuf::uint32, bool> p = - input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) - goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber( - tag)) { - // repeated .paddle_mobile.framework.proto.VarType.Type - // element_type = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { - int value; - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - int, ::google::protobuf::internal::WireFormatLite:: - TYPE_ENUM>(input, &value))); - if (::paddle_mobile::framework::proto::VarType_Type_IsValid( - value)) { - add_element_type( - static_cast< - ::paddle_mobile::framework::proto::VarType_Type>( - value)); - } else { - unknown_fields_stream.WriteVarint32(tag); - unknown_fields_stream.WriteVarint32( - static_cast<::google::protobuf::uint32>(value)); - } - } else if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>( - 10u /* 10 & 0xFF */)) { - DO_((::google::protobuf::internal::WireFormatLite:: - ReadPackedEnumPreserveUnknowns( - input, 1, - ::paddle_mobile::framework::proto:: - VarType_Type_IsValid, - &unknown_fields_stream, - this->mutable_element_type()))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } - } - } + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ + goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::NewPermanentCallback( + &_internal_metadata_, + &::google::protobuf::internal::InternalMetadataWithArenaLite:: + mutable_unknown_fields)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.VarType.Tuple) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = + input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) + goto handle_unusual; + switch ( + ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .paddle_mobile.framework.proto.VarType.Type + // element_type = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::paddle_mobile::framework::proto::VarType_Type_IsValid(value)) { + add_element_type( + static_cast<::paddle_mobile::framework::proto::VarType_Type>( + value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32( + static_cast<::google::protobuf::uint32>(value)); + } + } else if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_((::google::protobuf::internal::WireFormatLite:: + ReadPackedEnumPreserveUnknowns( + input, 1, + ::paddle_mobile::framework::proto::VarType_Type_IsValid, + &unknown_fields_stream, this->mutable_element_type()))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } success: - // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.VarType.Tuple) - return true; + // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.VarType.Tuple) + return true; failure: - // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.VarType.Tuple) - return false; + // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.VarType.Tuple) + return false; #undef DO_ } void VarType_Tuple::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream *output) const { - // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.VarType.Tuple) - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; + // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.VarType.Tuple) + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; - // repeated .paddle_mobile.framework.proto.VarType.Type - // element_type = 1; - for (int i = 0, n = this->element_type_size(); i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteEnum( - 1, this->element_type(i), output); - } + // repeated .paddle_mobile.framework.proto.VarType.Type + // element_type = 1; + for (int i = 0, n = this->element_type_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->element_type(i), output); + } - output->WriteRaw( - _internal_metadata_.unknown_fields().data(), - static_cast(_internal_metadata_.unknown_fields().size())); - // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.VarType.Tuple) + output->WriteRaw( + _internal_metadata_.unknown_fields().data(), + static_cast(_internal_metadata_.unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.VarType.Tuple) } size_t VarType_Tuple::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.VarType.Tuple) - size_t total_size = 0; + // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.VarType.Tuple) + size_t total_size = 0; - total_size += _internal_metadata_.unknown_fields().size(); + total_size += _internal_metadata_.unknown_fields().size(); - // repeated .paddle_mobile.framework.proto.VarType.Type - // element_type = 1; - { - size_t data_size = 0; - unsigned int count = - static_cast(this->element_type_size()); - for (unsigned int i = 0; i < count; i++) { - data_size += ::google::protobuf::internal::WireFormatLite::EnumSize( - this->element_type(static_cast(i))); - } - total_size += (1UL * count) + data_size; + // repeated .paddle_mobile.framework.proto.VarType.Type + // element_type = 1; + { + size_t data_size = 0; + unsigned int count = static_cast(this->element_type_size()); + for (unsigned int i = 0; i < count; i++) { + data_size += ::google::protobuf::internal::WireFormatLite::EnumSize( + this->element_type(static_cast(i))); } + total_size += (1UL * count) + data_size; + } - int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; } void VarType_Tuple::CheckTypeAndMergeFrom( const ::google::protobuf::MessageLite &from) { - MergeFrom(*::google::protobuf::down_cast(&from)); + MergeFrom(*::google::protobuf::down_cast(&from)); } void VarType_Tuple::MergeFrom(const VarType_Tuple &from) { - // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.VarType.Tuple) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; + // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.VarType.Tuple) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; - element_type_.MergeFrom(from.element_type_); + element_type_.MergeFrom(from.element_type_); } void VarType_Tuple::CopyFrom(const VarType_Tuple &from) { - // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType.Tuple) - if (&from == this) - return; - Clear(); - MergeFrom(from); + // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType.Tuple) + if (&from == this) + return; + Clear(); + MergeFrom(from); } bool VarType_Tuple::IsInitialized() const { return true; } void VarType_Tuple::Swap(VarType_Tuple *other) { - if (other == this) - return; - InternalSwap(other); + if (other == this) + return; + InternalSwap(other); } void VarType_Tuple::InternalSwap(VarType_Tuple *other) { - using std::swap; - element_type_.InternalSwap(&other->element_type_); - swap(_has_bits_[0], other->_has_bits_[0]); - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); + using std::swap; + element_type_.InternalSwap(&other->element_type_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); } ::std::string VarType_Tuple::GetTypeName() const { - return "paddle_mobile.framework.proto.VarType.Tuple"; + return "paddle_mobile.framework.proto.VarType.Tuple"; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -6003,35 +5914,35 @@ int VarType_Tuple::element_type_size() const { return element_type_.size(); } void VarType_Tuple::clear_element_type() { element_type_.Clear(); } ::paddle_mobile::framework::proto::VarType_Type VarType_Tuple::element_type(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.Tuple.element_type) - return static_cast<::paddle_mobile::framework::proto::VarType_Type>( - element_type_.Get(index)); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.Tuple.element_type) + return static_cast<::paddle_mobile::framework::proto::VarType_Type>( + element_type_.Get(index)); } void VarType_Tuple::set_element_type( int index, ::paddle_mobile::framework::proto::VarType_Type value) { - assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); - element_type_.Set(index, value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.Tuple.element_type) + assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); + element_type_.Set(index, value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.Tuple.element_type) } void VarType_Tuple::add_element_type( ::paddle_mobile::framework::proto::VarType_Type value) { - assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); - element_type_.Add(value); - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.VarType.Tuple.element_type) + assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); + element_type_.Add(value); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.VarType.Tuple.element_type) } const ::google::protobuf::RepeatedField & VarType_Tuple::element_type() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.Tuple.element_type) - return element_type_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.Tuple.element_type) + return element_type_; } ::google::protobuf::RepeatedField *VarType_Tuple::mutable_element_type() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.VarType.Tuple.element_type) - return &element_type_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.VarType.Tuple.element_type) + return &element_type_; } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS - // =================================================================== + // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int VarType::kTypeFieldNumber; @@ -6045,536 +5956,543 @@ const int VarType::kTupleFieldNumber; VarType::VarType() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_framework_2eproto::InitDefaults(); - } - SharedCtor(); - // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarType) + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + protobuf_framework_2eproto::InitDefaults(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarType) } VarType::VarType(const VarType &from) : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - if (from.has_selected_rows()) { - selected_rows_ = - new ::paddle_mobile::framework::proto::VarType_TensorDesc( - *from.selected_rows_); - } else { - selected_rows_ = NULL; - } - if (from.has_lod_tensor()) { - lod_tensor_ = - new ::paddle_mobile::framework::proto::VarType_LoDTensorDesc( - *from.lod_tensor_); - } else { - lod_tensor_ = NULL; - } - if (from.has_tensor_array()) { - tensor_array_ = - new ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc( - *from.tensor_array_); - } else { - tensor_array_ = NULL; - } - if (from.has_reader()) { - reader_ = new ::paddle_mobile::framework::proto::VarType_ReaderDesc( - *from.reader_); - } else { - reader_ = NULL; - } - if (from.has_channel()) { - channel_ = new ::paddle_mobile::framework::proto::VarType_ChannelDesc( - *from.channel_); - } else { - channel_ = NULL; - } - if (from.has_tuple()) { - tuple_ = - new ::paddle_mobile::framework::proto::VarType_Tuple(*from.tuple_); - } else { - tuple_ = NULL; - } - type_ = from.type_; - // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.VarType) + _internal_metadata_.MergeFrom(from._internal_metadata_); + if (from.has_selected_rows()) { + selected_rows_ = new ::paddle_mobile::framework::proto::VarType_TensorDesc( + *from.selected_rows_); + } else { + selected_rows_ = NULL; + } + if (from.has_lod_tensor()) { + lod_tensor_ = new ::paddle_mobile::framework::proto::VarType_LoDTensorDesc( + *from.lod_tensor_); + } else { + lod_tensor_ = NULL; + } + if (from.has_tensor_array()) { + tensor_array_ = + new ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc( + *from.tensor_array_); + } else { + tensor_array_ = NULL; + } + if (from.has_reader()) { + reader_ = new ::paddle_mobile::framework::proto::VarType_ReaderDesc( + *from.reader_); + } else { + reader_ = NULL; + } + if (from.has_channel()) { + channel_ = new ::paddle_mobile::framework::proto::VarType_ChannelDesc( + *from.channel_); + } else { + channel_ = NULL; + } + if (from.has_tuple()) { + tuple_ = new ::paddle_mobile::framework::proto::VarType_Tuple(*from.tuple_); + } else { + tuple_ = NULL; + } + type_ = from.type_; + // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.VarType) } void VarType::SharedCtor() { - _cached_size_ = 0; - ::memset(&selected_rows_, 0, - static_cast(reinterpret_cast(&type_) - - reinterpret_cast(&selected_rows_)) + - sizeof(type_)); + _cached_size_ = 0; + ::memset(&selected_rows_, 0, + static_cast(reinterpret_cast(&type_) - + reinterpret_cast(&selected_rows_)) + + sizeof(type_)); } VarType::~VarType() { - // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.VarType) - SharedDtor(); + // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.VarType) + SharedDtor(); } void VarType::SharedDtor() { - if (this != internal_default_instance()) - delete selected_rows_; - if (this != internal_default_instance()) - delete lod_tensor_; - if (this != internal_default_instance()) - delete tensor_array_; - if (this != internal_default_instance()) - delete reader_; - if (this != internal_default_instance()) - delete channel_; - if (this != internal_default_instance()) - delete tuple_; + if (this != internal_default_instance()) + delete selected_rows_; + if (this != internal_default_instance()) + delete lod_tensor_; + if (this != internal_default_instance()) + delete tensor_array_; + if (this != internal_default_instance()) + delete reader_; + if (this != internal_default_instance()) + delete channel_; + if (this != internal_default_instance()) + delete tuple_; } void VarType::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const VarType &VarType::default_instance() { - protobuf_framework_2eproto::InitDefaults(); - return *internal_default_instance(); + protobuf_framework_2eproto::InitDefaults(); + return *internal_default_instance(); } VarType *VarType::New(::google::protobuf::Arena *arena) const { - VarType *n = new VarType; - if (arena != NULL) { - arena->Own(n); - } - return n; + VarType *n = new VarType; + if (arena != NULL) { + arena->Own(n); + } + return n; } void VarType::Clear() { - // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.VarType) - ::google::protobuf::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void)cached_has_bits; - - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 63u) { - if (cached_has_bits & 0x00000001u) { - GOOGLE_DCHECK(selected_rows_ != NULL); - selected_rows_->::paddle_mobile::framework::proto:: - VarType_TensorDesc::Clear(); - } - if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(lod_tensor_ != NULL); - lod_tensor_->::paddle_mobile::framework::proto:: - VarType_LoDTensorDesc::Clear(); - } - if (cached_has_bits & 0x00000004u) { - GOOGLE_DCHECK(tensor_array_ != NULL); - tensor_array_->::paddle_mobile::framework::proto:: - VarType_LoDTensorArrayDesc::Clear(); - } - if (cached_has_bits & 0x00000008u) { - GOOGLE_DCHECK(reader_ != NULL); - reader_->::paddle_mobile::framework::proto::VarType_ReaderDesc:: - Clear(); - } - if (cached_has_bits & 0x00000010u) { - GOOGLE_DCHECK(channel_ != NULL); - channel_->::paddle_mobile::framework::proto::VarType_ChannelDesc:: - Clear(); - } - if (cached_has_bits & 0x00000020u) { - GOOGLE_DCHECK(tuple_ != NULL); - tuple_->::paddle_mobile::framework::proto::VarType_Tuple::Clear(); - } + // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.VarType) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 63u) { + if (cached_has_bits & 0x00000001u) { + GOOGLE_DCHECK(selected_rows_ != NULL); + selected_rows_ + ->::paddle_mobile::framework::proto::VarType_TensorDesc::Clear(); + } + if (cached_has_bits & 0x00000002u) { + GOOGLE_DCHECK(lod_tensor_ != NULL); + lod_tensor_ + ->::paddle_mobile::framework::proto::VarType_LoDTensorDesc::Clear(); + } + if (cached_has_bits & 0x00000004u) { + GOOGLE_DCHECK(tensor_array_ != NULL); + tensor_array_->::paddle_mobile::framework::proto:: + VarType_LoDTensorArrayDesc::Clear(); + } + if (cached_has_bits & 0x00000008u) { + GOOGLE_DCHECK(reader_ != NULL); + reader_->::paddle_mobile::framework::proto::VarType_ReaderDesc::Clear(); + } + if (cached_has_bits & 0x00000010u) { + GOOGLE_DCHECK(channel_ != NULL); + channel_->::paddle_mobile::framework::proto::VarType_ChannelDesc::Clear(); + } + if (cached_has_bits & 0x00000020u) { + GOOGLE_DCHECK(tuple_ != NULL); + tuple_->::paddle_mobile::framework::proto::VarType_Tuple::Clear(); } - type_ = 0; - _has_bits_.Clear(); - _internal_metadata_.Clear(); + } + type_ = 0; + _has_bits_.Clear(); + _internal_metadata_.Clear(); } bool VarType::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::NewPermanentCallback( - &_internal_metadata_, - &::google::protobuf::internal::InternalMetadataWithArenaLite:: - mutable_unknown_fields)); - ::google::protobuf::io::CodedOutputStream unknown_fields_stream( - &unknown_fields_string, false); - // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.VarType) - for (;;) { - ::std::pair<::google::protobuf::uint32, bool> p = - input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) - goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber( - tag)) { - // required .paddle_mobile.framework.proto.VarType.Type type - // = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { - int value; - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - int, ::google::protobuf::internal::WireFormatLite:: - TYPE_ENUM>(input, &value))); - if (::paddle_mobile::framework::proto::VarType_Type_IsValid( - value)) { - set_type(static_cast< - ::paddle_mobile::framework::proto::VarType_Type>( - value)); - } else { - unknown_fields_stream.WriteVarint32(8u); - unknown_fields_stream.WriteVarint32( - static_cast<::google::protobuf::uint32>(value)); - } - } else { - goto handle_unusual; - } - break; - } - - // optional - // .paddle_mobile.framework.proto.VarType.TensorDesc - // selected_rows = 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite:: - ReadMessageNoVirtual(input, mutable_selected_rows())); - } else { - goto handle_unusual; - } - break; - } - - // optional - // .paddle_mobile.framework.proto.VarType.LoDTensorDesc - // lod_tensor = 3; - case 3: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite:: - ReadMessageNoVirtual(input, mutable_lod_tensor())); - } else { - goto handle_unusual; - } - break; - } - - // optional - // .paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc - // tensor_array = 4; - case 4: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite:: - ReadMessageNoVirtual(input, mutable_tensor_array())); - } else { - goto handle_unusual; - } - break; - } + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ + goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::NewPermanentCallback( + &_internal_metadata_, + &::google::protobuf::internal::InternalMetadataWithArenaLite:: + mutable_unknown_fields)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.VarType) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = + input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) + goto handle_unusual; + switch ( + ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required .paddle_mobile.framework.proto.VarType.Type type + // = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::paddle_mobile::framework::proto::VarType_Type_IsValid(value)) { + set_type(static_cast<::paddle_mobile::framework::proto::VarType_Type>( + value)); + } else { + unknown_fields_stream.WriteVarint32(8u); + unknown_fields_stream.WriteVarint32( + static_cast<::google::protobuf::uint32>(value)); + } + } else { + goto handle_unusual; + } + break; + } - // optional - // .paddle_mobile.framework.proto.VarType.ReaderDesc reader - // = 5; - case 5: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite:: - ReadMessageNoVirtual(input, mutable_reader())); - } else { - goto handle_unusual; - } - break; - } + // optional + // .paddle_mobile.framework.proto.VarType.TensorDesc + // selected_rows = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_selected_rows())); + } else { + goto handle_unusual; + } + break; + } - // optional - // .paddle_mobile.framework.proto.VarType.ChannelDesc - // channel = - // 6; - case 6: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite:: - ReadMessageNoVirtual(input, mutable_channel())); - } else { - goto handle_unusual; - } - break; - } + // optional + // .paddle_mobile.framework.proto.VarType.LoDTensorDesc + // lod_tensor = 3; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_lod_tensor())); + } else { + goto handle_unusual; + } + break; + } - // optional .paddle_mobile.framework.proto.VarType.Tuple - // tuple = 7; - case 7: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite:: - ReadMessageNoVirtual(input, mutable_tuple())); - } else { - goto handle_unusual; - } - break; - } + // optional + // .paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc + // tensor_array = 4; + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_tensor_array())); + } else { + goto handle_unusual; + } + break; + } - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } - } + // optional + // .paddle_mobile.framework.proto.VarType.ReaderDesc reader + // = 5; + case 5: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(42u /* 42 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_reader())); + } else { + goto handle_unusual; + } + break; } + + // optional + // .paddle_mobile.framework.proto.VarType.ChannelDesc + // channel = + // 6; + case 6: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(50u /* 50 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_channel())); + } else { + goto handle_unusual; + } + break; + } + + // optional .paddle_mobile.framework.proto.VarType.Tuple + // tuple = 7; + case 7: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(58u /* 58 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_tuple())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } success: - // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.VarType) - return true; + // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.VarType) + return true; failure: - // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.VarType) - return false; + // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.VarType) + return false; #undef DO_ } void VarType::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream *output) const { - // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.VarType) - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _has_bits_[0]; - // required .paddle_mobile.framework.proto.VarType.Type type = - // 1; - if (cached_has_bits & 0x00000040u) { - ::google::protobuf::internal::WireFormatLite::WriteEnum(1, this->type(), - output); - } + // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.VarType) + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required .paddle_mobile.framework.proto.VarType.Type type = + // 1; + if (cached_has_bits & 0x00000040u) { + ::google::protobuf::internal::WireFormatLite::WriteEnum(1, this->type(), + output); + } + + // optional .paddle_mobile.framework.proto.VarType.TensorDesc + // selected_rows = + // 2; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, *this->selected_rows_, output); + } + + // optional .paddle_mobile.framework.proto.VarType.LoDTensorDesc + // lod_tensor = + // 3; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 3, *this->lod_tensor_, output); + } + + // optional + // .paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc + // tensor_array = 4; + if (cached_has_bits & 0x00000004u) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 4, *this->tensor_array_, output); + } + + // optional .paddle_mobile.framework.proto.VarType.ReaderDesc + // reader = 5; + if (cached_has_bits & 0x00000008u) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 5, *this->reader_, output); + } + + // optional .paddle_mobile.framework.proto.VarType.ChannelDesc + // channel = 6; + if (cached_has_bits & 0x00000010u) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 6, *this->channel_, output); + } + + // optional .paddle_mobile.framework.proto.VarType.Tuple tuple = + // 7; + if (cached_has_bits & 0x00000020u) { + ::google::protobuf::internal::WireFormatLite::WriteMessage(7, *this->tuple_, + output); + } + + output->WriteRaw( + _internal_metadata_.unknown_fields().data(), + static_cast(_internal_metadata_.unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.VarType) +} - // optional .paddle_mobile.framework.proto.VarType.TensorDesc - // selected_rows = - // 2; - if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 2, *this->selected_rows_, output); +size_t VarType::ByteSizeLong() const { + // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.VarType) + size_t total_size = 0; + + total_size += _internal_metadata_.unknown_fields().size(); + + // required .paddle_mobile.framework.proto.VarType.Type type = + // 1; + if (has_type()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::EnumSize( + this->type()); + } + if (_has_bits_[0 / 32] & 63u) { + // optional + // .paddle_mobile.framework.proto.VarType.TensorDesc + // selected_rows + // = 2; + if (has_selected_rows()) { + total_size += + 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->selected_rows_); } - // optional .paddle_mobile.framework.proto.VarType.LoDTensorDesc - // lod_tensor = - // 3; - if (cached_has_bits & 0x00000002u) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 3, *this->lod_tensor_, output); + // optional + // .paddle_mobile.framework.proto.VarType.LoDTensorDesc + // lod_tensor + // = 3; + if (has_lod_tensor()) { + total_size += + 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->lod_tensor_); } // optional // .paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc // tensor_array = 4; - if (cached_has_bits & 0x00000004u) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 4, *this->tensor_array_, output); + if (has_tensor_array()) { + total_size += + 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->tensor_array_); } - // optional .paddle_mobile.framework.proto.VarType.ReaderDesc - // reader = 5; - if (cached_has_bits & 0x00000008u) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 5, *this->reader_, output); + // optional + // .paddle_mobile.framework.proto.VarType.ReaderDesc reader + // = 5; + if (has_reader()) { + total_size += + 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->reader_); } - // optional .paddle_mobile.framework.proto.VarType.ChannelDesc + // optional + // .paddle_mobile.framework.proto.VarType.ChannelDesc // channel = 6; - if (cached_has_bits & 0x00000010u) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 6, *this->channel_, output); - } - - // optional .paddle_mobile.framework.proto.VarType.Tuple tuple = - // 7; - if (cached_has_bits & 0x00000020u) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 7, *this->tuple_, output); + if (has_channel()) { + total_size += + 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->channel_); } - output->WriteRaw( - _internal_metadata_.unknown_fields().data(), - static_cast(_internal_metadata_.unknown_fields().size())); - // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.VarType) -} - -size_t VarType::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.VarType) - size_t total_size = 0; - - total_size += _internal_metadata_.unknown_fields().size(); - - // required .paddle_mobile.framework.proto.VarType.Type type = - // 1; - if (has_type()) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::EnumSize( - this->type()); - } - if (_has_bits_[0 / 32] & 63u) { - // optional - // .paddle_mobile.framework.proto.VarType.TensorDesc - // selected_rows - // = 2; - if (has_selected_rows()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite:: - MessageSizeNoVirtual(*this->selected_rows_); - } - - // optional - // .paddle_mobile.framework.proto.VarType.LoDTensorDesc - // lod_tensor - // = 3; - if (has_lod_tensor()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite:: - MessageSizeNoVirtual(*this->lod_tensor_); - } - - // optional - // .paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc - // tensor_array = 4; - if (has_tensor_array()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite:: - MessageSizeNoVirtual(*this->tensor_array_); - } - - // optional - // .paddle_mobile.framework.proto.VarType.ReaderDesc reader - // = 5; - if (has_reader()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite:: - MessageSizeNoVirtual(*this->reader_); - } - - // optional - // .paddle_mobile.framework.proto.VarType.ChannelDesc - // channel = 6; - if (has_channel()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite:: - MessageSizeNoVirtual(*this->channel_); - } - - // optional .paddle_mobile.framework.proto.VarType.Tuple - // tuple = 7; - if (has_tuple()) { - total_size += 1 + ::google::protobuf::internal::WireFormatLite:: - MessageSizeNoVirtual(*this->tuple_); - } + // optional .paddle_mobile.framework.proto.VarType.Tuple + // tuple = 7; + if (has_tuple()) { + total_size += + 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->tuple_); } - int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; + } + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; } void VarType::CheckTypeAndMergeFrom( const ::google::protobuf::MessageLite &from) { - MergeFrom(*::google::protobuf::down_cast(&from)); + MergeFrom(*::google::protobuf::down_cast(&from)); } void VarType::MergeFrom(const VarType &from) { - // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.VarType) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = from._has_bits_[0]; - if (cached_has_bits & 127u) { - if (cached_has_bits & 0x00000001u) { - mutable_selected_rows()->::paddle_mobile::framework::proto:: - VarType_TensorDesc::MergeFrom(from.selected_rows()); - } - if (cached_has_bits & 0x00000002u) { - mutable_lod_tensor()->::paddle_mobile::framework::proto:: - VarType_LoDTensorDesc::MergeFrom(from.lod_tensor()); - } - if (cached_has_bits & 0x00000004u) { - mutable_tensor_array()->::paddle_mobile::framework::proto:: - VarType_LoDTensorArrayDesc::MergeFrom(from.tensor_array()); - } - if (cached_has_bits & 0x00000008u) { - mutable_reader()->::paddle_mobile::framework::proto:: - VarType_ReaderDesc::MergeFrom(from.reader()); - } - if (cached_has_bits & 0x00000010u) { - mutable_channel()->::paddle_mobile::framework::proto:: - VarType_ChannelDesc::MergeFrom(from.channel()); - } - if (cached_has_bits & 0x00000020u) { - mutable_tuple() - ->::paddle_mobile::framework::proto::VarType_Tuple::MergeFrom( - from.tuple()); - } - if (cached_has_bits & 0x00000040u) { - type_ = from.type_; - } - _has_bits_[0] |= cached_has_bits; + // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.VarType) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 127u) { + if (cached_has_bits & 0x00000001u) { + mutable_selected_rows() + ->::paddle_mobile::framework::proto::VarType_TensorDesc::MergeFrom( + from.selected_rows()); } -} - -void VarType::CopyFrom(const VarType &from) { - // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType) - if (&from == this) - return; - Clear(); - MergeFrom(from); -} - -bool VarType::IsInitialized() const { - if ((_has_bits_[0] & 0x00000040) != 0x00000040) - return false; - if (has_selected_rows()) { - if (!this->selected_rows_->IsInitialized()) - return false; + if (cached_has_bits & 0x00000002u) { + mutable_lod_tensor() + ->::paddle_mobile::framework::proto::VarType_LoDTensorDesc::MergeFrom( + from.lod_tensor()); } - if (has_lod_tensor()) { - if (!this->lod_tensor_->IsInitialized()) - return false; + if (cached_has_bits & 0x00000004u) { + mutable_tensor_array()->::paddle_mobile::framework::proto:: + VarType_LoDTensorArrayDesc::MergeFrom(from.tensor_array()); } - if (has_tensor_array()) { - if (!this->tensor_array_->IsInitialized()) - return false; + if (cached_has_bits & 0x00000008u) { + mutable_reader() + ->::paddle_mobile::framework::proto::VarType_ReaderDesc::MergeFrom( + from.reader()); } - if (has_reader()) { - if (!this->reader_->IsInitialized()) - return false; + if (cached_has_bits & 0x00000010u) { + mutable_channel() + ->::paddle_mobile::framework::proto::VarType_ChannelDesc::MergeFrom( + from.channel()); + } + if (cached_has_bits & 0x00000020u) { + mutable_tuple() + ->::paddle_mobile::framework::proto::VarType_Tuple::MergeFrom( + from.tuple()); } - if (has_channel()) { - if (!this->channel_->IsInitialized()) - return false; + if (cached_has_bits & 0x00000040u) { + type_ = from.type_; } - return true; + _has_bits_[0] |= cached_has_bits; + } +} + +void VarType::CopyFrom(const VarType &from) { + // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarType) + if (&from == this) + return; + Clear(); + MergeFrom(from); +} + +bool VarType::IsInitialized() const { + if ((_has_bits_[0] & 0x00000040) != 0x00000040) + return false; + if (has_selected_rows()) { + if (!this->selected_rows_->IsInitialized()) + return false; + } + if (has_lod_tensor()) { + if (!this->lod_tensor_->IsInitialized()) + return false; + } + if (has_tensor_array()) { + if (!this->tensor_array_->IsInitialized()) + return false; + } + if (has_reader()) { + if (!this->reader_->IsInitialized()) + return false; + } + if (has_channel()) { + if (!this->channel_->IsInitialized()) + return false; + } + return true; } void VarType::Swap(VarType *other) { - if (other == this) - return; - InternalSwap(other); + if (other == this) + return; + InternalSwap(other); } void VarType::InternalSwap(VarType *other) { - using std::swap; - swap(selected_rows_, other->selected_rows_); - swap(lod_tensor_, other->lod_tensor_); - swap(tensor_array_, other->tensor_array_); - swap(reader_, other->reader_); - swap(channel_, other->channel_); - swap(tuple_, other->tuple_); - swap(type_, other->type_); - swap(_has_bits_[0], other->_has_bits_[0]); - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); + using std::swap; + swap(selected_rows_, other->selected_rows_); + swap(lod_tensor_, other->lod_tensor_); + swap(tensor_array_, other->tensor_array_); + swap(reader_, other->reader_); + swap(channel_, other->channel_); + swap(tuple_, other->tuple_); + swap(type_, other->type_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); } ::std::string VarType::GetTypeName() const { - return "paddle_mobile.framework.proto.VarType"; + return "paddle_mobile.framework.proto.VarType"; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -6585,187 +6503,182 @@ bool VarType::has_type() const { return (_has_bits_[0] & 0x00000040u) != 0; } void VarType::set_has_type() { _has_bits_[0] |= 0x00000040u; } void VarType::clear_has_type() { _has_bits_[0] &= ~0x00000040u; } void VarType::clear_type() { - type_ = 0; - clear_has_type(); + type_ = 0; + clear_has_type(); } ::paddle_mobile::framework::proto::VarType_Type VarType::type() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.type) - return static_cast<::paddle_mobile::framework::proto::VarType_Type>(type_); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.type) + return static_cast<::paddle_mobile::framework::proto::VarType_Type>(type_); } void VarType::set_type(::paddle_mobile::framework::proto::VarType_Type value) { - assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); - set_has_type(); - type_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.type) + assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.type) } // optional .paddle_mobile.framework.proto.VarType.TensorDesc // selected_rows = 2; bool VarType::has_selected_rows() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } void VarType::set_has_selected_rows() { _has_bits_[0] |= 0x00000001u; } void VarType::clear_has_selected_rows() { _has_bits_[0] &= ~0x00000001u; } void VarType::clear_selected_rows() { - if (selected_rows_ != NULL) - selected_rows_ - ->::paddle_mobile::framework::proto::VarType_TensorDesc::Clear(); - clear_has_selected_rows(); + if (selected_rows_ != NULL) + selected_rows_ + ->::paddle_mobile::framework::proto::VarType_TensorDesc::Clear(); + clear_has_selected_rows(); } const ::paddle_mobile::framework::proto::VarType_TensorDesc & VarType::selected_rows() const { - const ::paddle_mobile::framework::proto::VarType_TensorDesc *p = - selected_rows_; - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.selected_rows) - return p != NULL - ? *p - : *reinterpret_cast< - const ::paddle_mobile::framework::proto::VarType_TensorDesc - *>(&::paddle_mobile::framework::proto:: - _VarType_TensorDesc_default_instance_); + const ::paddle_mobile::framework::proto::VarType_TensorDesc *p = + selected_rows_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.selected_rows) + return p != NULL + ? *p + : *reinterpret_cast< + const ::paddle_mobile::framework::proto::VarType_TensorDesc + *>(&::paddle_mobile::framework::proto:: + _VarType_TensorDesc_default_instance_); } ::paddle_mobile::framework::proto::VarType_TensorDesc * VarType::mutable_selected_rows() { - set_has_selected_rows(); - if (selected_rows_ == NULL) { - selected_rows_ = - new ::paddle_mobile::framework::proto::VarType_TensorDesc; - } - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.selected_rows) - return selected_rows_; + set_has_selected_rows(); + if (selected_rows_ == NULL) { + selected_rows_ = new ::paddle_mobile::framework::proto::VarType_TensorDesc; + } + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.selected_rows) + return selected_rows_; } ::paddle_mobile::framework::proto::VarType_TensorDesc * VarType::release_selected_rows() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.selected_rows) - clear_has_selected_rows(); - ::paddle_mobile::framework::proto::VarType_TensorDesc *temp = - selected_rows_; - selected_rows_ = NULL; - return temp; + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.selected_rows) + clear_has_selected_rows(); + ::paddle_mobile::framework::proto::VarType_TensorDesc *temp = selected_rows_; + selected_rows_ = NULL; + return temp; } void VarType::set_allocated_selected_rows( ::paddle_mobile::framework::proto::VarType_TensorDesc *selected_rows) { - delete selected_rows_; - selected_rows_ = selected_rows; - if (selected_rows) { - set_has_selected_rows(); - } else { - clear_has_selected_rows(); - } - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.selected_rows) + delete selected_rows_; + selected_rows_ = selected_rows; + if (selected_rows) { + set_has_selected_rows(); + } else { + clear_has_selected_rows(); + } + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.selected_rows) } // optional .paddle_mobile.framework.proto.VarType.LoDTensorDesc // lod_tensor = 3; bool VarType::has_lod_tensor() const { - return (_has_bits_[0] & 0x00000002u) != 0; + return (_has_bits_[0] & 0x00000002u) != 0; } void VarType::set_has_lod_tensor() { _has_bits_[0] |= 0x00000002u; } void VarType::clear_has_lod_tensor() { _has_bits_[0] &= ~0x00000002u; } void VarType::clear_lod_tensor() { - if (lod_tensor_ != NULL) - lod_tensor_ - ->::paddle_mobile::framework::proto::VarType_LoDTensorDesc::Clear(); - clear_has_lod_tensor(); + if (lod_tensor_ != NULL) + lod_tensor_ + ->::paddle_mobile::framework::proto::VarType_LoDTensorDesc::Clear(); + clear_has_lod_tensor(); } const ::paddle_mobile::framework::proto::VarType_LoDTensorDesc & VarType::lod_tensor() const { - const ::paddle_mobile::framework::proto::VarType_LoDTensorDesc *p = - lod_tensor_; - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.lod_tensor) - return p != NULL ? *p - : *reinterpret_cast( - &::paddle_mobile::framework::proto:: - _VarType_LoDTensorDesc_default_instance_); + const ::paddle_mobile::framework::proto::VarType_LoDTensorDesc *p = + lod_tensor_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.lod_tensor) + return p != NULL ? *p + : *reinterpret_cast( + &::paddle_mobile::framework::proto:: + _VarType_LoDTensorDesc_default_instance_); } ::paddle_mobile::framework::proto::VarType_LoDTensorDesc * VarType::mutable_lod_tensor() { - set_has_lod_tensor(); - if (lod_tensor_ == NULL) { - lod_tensor_ = - new ::paddle_mobile::framework::proto::VarType_LoDTensorDesc; - } - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.lod_tensor) - return lod_tensor_; + set_has_lod_tensor(); + if (lod_tensor_ == NULL) { + lod_tensor_ = new ::paddle_mobile::framework::proto::VarType_LoDTensorDesc; + } + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.lod_tensor) + return lod_tensor_; } ::paddle_mobile::framework::proto::VarType_LoDTensorDesc * VarType::release_lod_tensor() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.lod_tensor) - clear_has_lod_tensor(); - ::paddle_mobile::framework::proto::VarType_LoDTensorDesc *temp = - lod_tensor_; - lod_tensor_ = NULL; - return temp; + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.lod_tensor) + clear_has_lod_tensor(); + ::paddle_mobile::framework::proto::VarType_LoDTensorDesc *temp = lod_tensor_; + lod_tensor_ = NULL; + return temp; } void VarType::set_allocated_lod_tensor( ::paddle_mobile::framework::proto::VarType_LoDTensorDesc *lod_tensor) { - delete lod_tensor_; - lod_tensor_ = lod_tensor; - if (lod_tensor) { - set_has_lod_tensor(); - } else { - clear_has_lod_tensor(); - } - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.lod_tensor) + delete lod_tensor_; + lod_tensor_ = lod_tensor; + if (lod_tensor) { + set_has_lod_tensor(); + } else { + clear_has_lod_tensor(); + } + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.lod_tensor) } // optional // .paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc // tensor_array = 4; bool VarType::has_tensor_array() const { - return (_has_bits_[0] & 0x00000004u) != 0; + return (_has_bits_[0] & 0x00000004u) != 0; } void VarType::set_has_tensor_array() { _has_bits_[0] |= 0x00000004u; } void VarType::clear_has_tensor_array() { _has_bits_[0] &= ~0x00000004u; } void VarType::clear_tensor_array() { - if (tensor_array_ != NULL) - tensor_array_->::paddle_mobile::framework::proto:: - VarType_LoDTensorArrayDesc::Clear(); - clear_has_tensor_array(); + if (tensor_array_ != NULL) + tensor_array_->::paddle_mobile::framework::proto:: + VarType_LoDTensorArrayDesc::Clear(); + clear_has_tensor_array(); } const ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc & VarType::tensor_array() const { - const ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc *p = - tensor_array_; - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.tensor_array) - return p != NULL - ? *p - : *reinterpret_cast( - &::paddle_mobile::framework::proto:: - _VarType_LoDTensorArrayDesc_default_instance_); + const ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc *p = + tensor_array_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.tensor_array) + return p != NULL ? *p + : *reinterpret_cast( + &::paddle_mobile::framework::proto:: + _VarType_LoDTensorArrayDesc_default_instance_); } ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc * VarType::mutable_tensor_array() { - set_has_tensor_array(); - if (tensor_array_ == NULL) { - tensor_array_ = - new ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc; - } - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.tensor_array) - return tensor_array_; + set_has_tensor_array(); + if (tensor_array_ == NULL) { + tensor_array_ = + new ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc; + } + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.tensor_array) + return tensor_array_; } ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc * VarType::release_tensor_array() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.tensor_array) - clear_has_tensor_array(); - ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc *temp = - tensor_array_; - tensor_array_ = NULL; - return temp; + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.tensor_array) + clear_has_tensor_array(); + ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc *temp = + tensor_array_; + tensor_array_ = NULL; + return temp; } void VarType::set_allocated_tensor_array( ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc *tensor_array) { - delete tensor_array_; - tensor_array_ = tensor_array; - if (tensor_array) { - set_has_tensor_array(); - } else { - clear_has_tensor_array(); - } - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.tensor_array) + delete tensor_array_; + tensor_array_ = tensor_array; + if (tensor_array) { + set_has_tensor_array(); + } else { + clear_has_tensor_array(); + } + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.tensor_array) } // optional .paddle_mobile.framework.proto.VarType.ReaderDesc reader @@ -6774,48 +6687,48 @@ bool VarType::has_reader() const { return (_has_bits_[0] & 0x00000008u) != 0; } void VarType::set_has_reader() { _has_bits_[0] |= 0x00000008u; } void VarType::clear_has_reader() { _has_bits_[0] &= ~0x00000008u; } void VarType::clear_reader() { - if (reader_ != NULL) - reader_->::paddle_mobile::framework::proto::VarType_ReaderDesc::Clear(); - clear_has_reader(); + if (reader_ != NULL) + reader_->::paddle_mobile::framework::proto::VarType_ReaderDesc::Clear(); + clear_has_reader(); } const ::paddle_mobile::framework::proto::VarType_ReaderDesc & VarType::reader() const { - const ::paddle_mobile::framework::proto::VarType_ReaderDesc *p = reader_; - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.reader) - return p != NULL - ? *p - : *reinterpret_cast< - const ::paddle_mobile::framework::proto::VarType_ReaderDesc - *>(&::paddle_mobile::framework::proto:: - _VarType_ReaderDesc_default_instance_); + const ::paddle_mobile::framework::proto::VarType_ReaderDesc *p = reader_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.reader) + return p != NULL + ? *p + : *reinterpret_cast< + const ::paddle_mobile::framework::proto::VarType_ReaderDesc + *>(&::paddle_mobile::framework::proto:: + _VarType_ReaderDesc_default_instance_); } ::paddle_mobile::framework::proto::VarType_ReaderDesc * VarType::mutable_reader() { - set_has_reader(); - if (reader_ == NULL) { - reader_ = new ::paddle_mobile::framework::proto::VarType_ReaderDesc; - } - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.reader) - return reader_; + set_has_reader(); + if (reader_ == NULL) { + reader_ = new ::paddle_mobile::framework::proto::VarType_ReaderDesc; + } + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.reader) + return reader_; } ::paddle_mobile::framework::proto::VarType_ReaderDesc * VarType::release_reader() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.reader) - clear_has_reader(); - ::paddle_mobile::framework::proto::VarType_ReaderDesc *temp = reader_; - reader_ = NULL; - return temp; + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.reader) + clear_has_reader(); + ::paddle_mobile::framework::proto::VarType_ReaderDesc *temp = reader_; + reader_ = NULL; + return temp; } void VarType::set_allocated_reader( ::paddle_mobile::framework::proto::VarType_ReaderDesc *reader) { - delete reader_; - reader_ = reader; - if (reader) { - set_has_reader(); - } else { - clear_has_reader(); - } - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.reader) + delete reader_; + reader_ = reader; + if (reader) { + set_has_reader(); + } else { + clear_has_reader(); + } + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.reader) } // optional .paddle_mobile.framework.proto.VarType.ChannelDesc @@ -6824,48 +6737,48 @@ bool VarType::has_channel() const { return (_has_bits_[0] & 0x00000010u) != 0; } void VarType::set_has_channel() { _has_bits_[0] |= 0x00000010u; } void VarType::clear_has_channel() { _has_bits_[0] &= ~0x00000010u; } void VarType::clear_channel() { - if (channel_ != NULL) - channel_ - ->::paddle_mobile::framework::proto::VarType_ChannelDesc::Clear(); - clear_has_channel(); + if (channel_ != NULL) + channel_->::paddle_mobile::framework::proto::VarType_ChannelDesc::Clear(); + clear_has_channel(); } const ::paddle_mobile::framework::proto::VarType_ChannelDesc & VarType::channel() const { - const ::paddle_mobile::framework::proto::VarType_ChannelDesc *p = channel_; - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.channel) - return p != NULL ? *p - : *reinterpret_cast( - &::paddle_mobile::framework::proto:: - _VarType_ChannelDesc_default_instance_); + const ::paddle_mobile::framework::proto::VarType_ChannelDesc *p = channel_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.channel) + return p != NULL + ? *p + : *reinterpret_cast< + const ::paddle_mobile::framework::proto::VarType_ChannelDesc + *>(&::paddle_mobile::framework::proto:: + _VarType_ChannelDesc_default_instance_); } ::paddle_mobile::framework::proto::VarType_ChannelDesc * VarType::mutable_channel() { - set_has_channel(); - if (channel_ == NULL) { - channel_ = new ::paddle_mobile::framework::proto::VarType_ChannelDesc; - } - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.channel) - return channel_; + set_has_channel(); + if (channel_ == NULL) { + channel_ = new ::paddle_mobile::framework::proto::VarType_ChannelDesc; + } + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.channel) + return channel_; } ::paddle_mobile::framework::proto::VarType_ChannelDesc * VarType::release_channel() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.channel) - clear_has_channel(); - ::paddle_mobile::framework::proto::VarType_ChannelDesc *temp = channel_; - channel_ = NULL; - return temp; + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.channel) + clear_has_channel(); + ::paddle_mobile::framework::proto::VarType_ChannelDesc *temp = channel_; + channel_ = NULL; + return temp; } void VarType::set_allocated_channel( ::paddle_mobile::framework::proto::VarType_ChannelDesc *channel) { - delete channel_; - channel_ = channel; - if (channel) { - set_has_channel(); - } else { - clear_has_channel(); - } - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.channel) + delete channel_; + channel_ = channel; + if (channel) { + set_has_channel(); + } else { + clear_has_channel(); + } + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.channel) } // optional .paddle_mobile.framework.proto.VarType.Tuple tuple = 7; @@ -6873,50 +6786,50 @@ bool VarType::has_tuple() const { return (_has_bits_[0] & 0x00000020u) != 0; } void VarType::set_has_tuple() { _has_bits_[0] |= 0x00000020u; } void VarType::clear_has_tuple() { _has_bits_[0] &= ~0x00000020u; } void VarType::clear_tuple() { - if (tuple_ != NULL) - tuple_->::paddle_mobile::framework::proto::VarType_Tuple::Clear(); - clear_has_tuple(); + if (tuple_ != NULL) + tuple_->::paddle_mobile::framework::proto::VarType_Tuple::Clear(); + clear_has_tuple(); } const ::paddle_mobile::framework::proto::VarType_Tuple &VarType::tuple() const { - const ::paddle_mobile::framework::proto::VarType_Tuple *p = tuple_; - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.tuple) - return p != NULL - ? *p - : *reinterpret_cast< - const ::paddle_mobile::framework::proto::VarType_Tuple *>( - &::paddle_mobile::framework::proto:: - _VarType_Tuple_default_instance_); + const ::paddle_mobile::framework::proto::VarType_Tuple *p = tuple_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.tuple) + return p != NULL + ? *p + : *reinterpret_cast< + const ::paddle_mobile::framework::proto::VarType_Tuple *>( + &::paddle_mobile::framework::proto:: + _VarType_Tuple_default_instance_); } ::paddle_mobile::framework::proto::VarType_Tuple *VarType::mutable_tuple() { - set_has_tuple(); - if (tuple_ == NULL) { - tuple_ = new ::paddle_mobile::framework::proto::VarType_Tuple; - } - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.tuple) - return tuple_; + set_has_tuple(); + if (tuple_ == NULL) { + tuple_ = new ::paddle_mobile::framework::proto::VarType_Tuple; + } + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.tuple) + return tuple_; } ::paddle_mobile::framework::proto::VarType_Tuple *VarType::release_tuple() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.tuple) - clear_has_tuple(); - ::paddle_mobile::framework::proto::VarType_Tuple *temp = tuple_; - tuple_ = NULL; - return temp; + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.tuple) + clear_has_tuple(); + ::paddle_mobile::framework::proto::VarType_Tuple *temp = tuple_; + tuple_ = NULL; + return temp; } void VarType::set_allocated_tuple( ::paddle_mobile::framework::proto::VarType_Tuple *tuple) { - delete tuple_; - tuple_ = tuple; - if (tuple) { - set_has_tuple(); - } else { - clear_has_tuple(); - } - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.tuple) + delete tuple_; + tuple_ = tuple; + if (tuple) { + set_has_tuple(); + } else { + clear_has_tuple(); + } + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.tuple) } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS - // =================================================================== + // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int VarDesc::kNameFieldNumber; @@ -6926,329 +6839,323 @@ const int VarDesc::kPersistableFieldNumber; VarDesc::VarDesc() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_framework_2eproto::InitDefaults(); - } - SharedCtor(); - // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarDesc) + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + protobuf_framework_2eproto::InitDefaults(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.VarDesc) } VarDesc::VarDesc(const VarDesc &from) : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - name_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (from.has_name()) { - name_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.name_); - } - if (from.has_type()) { - type_ = new ::paddle_mobile::framework::proto::VarType(*from.type_); - } else { - type_ = NULL; - } - persistable_ = from.persistable_; - // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.VarDesc) + _internal_metadata_.MergeFrom(from._internal_metadata_); + name_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (from.has_name()) { + name_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.name_); + } + if (from.has_type()) { + type_ = new ::paddle_mobile::framework::proto::VarType(*from.type_); + } else { + type_ = NULL; + } + persistable_ = from.persistable_; + // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.VarDesc) } void VarDesc::SharedCtor() { - _cached_size_ = 0; - name_.UnsafeSetDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - ::memset(&type_, 0, - static_cast(reinterpret_cast(&persistable_) - - reinterpret_cast(&type_)) + - sizeof(persistable_)); + _cached_size_ = 0; + name_.UnsafeSetDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(&type_, 0, + static_cast(reinterpret_cast(&persistable_) - + reinterpret_cast(&type_)) + + sizeof(persistable_)); } VarDesc::~VarDesc() { - // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.VarDesc) - SharedDtor(); + // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.VarDesc) + SharedDtor(); } void VarDesc::SharedDtor() { - name_.DestroyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) - delete type_; + name_.DestroyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) + delete type_; } void VarDesc::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const VarDesc &VarDesc::default_instance() { - protobuf_framework_2eproto::InitDefaults(); - return *internal_default_instance(); + protobuf_framework_2eproto::InitDefaults(); + return *internal_default_instance(); } VarDesc *VarDesc::New(::google::protobuf::Arena *arena) const { - VarDesc *n = new VarDesc; - if (arena != NULL) { - arena->Own(n); - } - return n; + VarDesc *n = new VarDesc; + if (arena != NULL) { + arena->Own(n); + } + return n; } void VarDesc::Clear() { - // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.VarDesc) - ::google::protobuf::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void)cached_has_bits; - - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 3u) { - if (cached_has_bits & 0x00000001u) { - GOOGLE_DCHECK(!name_.IsDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited())); - (*name_.UnsafeRawStringPointer())->clear(); - } - if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(type_ != NULL); - type_->::paddle_mobile::framework::proto::VarType::Clear(); - } + // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.VarDesc) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 3u) { + if (cached_has_bits & 0x00000001u) { + GOOGLE_DCHECK(!name_.IsDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited())); + (*name_.UnsafeRawStringPointer())->clear(); + } + if (cached_has_bits & 0x00000002u) { + GOOGLE_DCHECK(type_ != NULL); + type_->::paddle_mobile::framework::proto::VarType::Clear(); } - persistable_ = false; - _has_bits_.Clear(); - _internal_metadata_.Clear(); + } + persistable_ = false; + _has_bits_.Clear(); + _internal_metadata_.Clear(); } bool VarDesc::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::NewPermanentCallback( - &_internal_metadata_, - &::google::protobuf::internal::InternalMetadataWithArenaLite:: - mutable_unknown_fields)); - ::google::protobuf::io::CodedOutputStream unknown_fields_stream( - &unknown_fields_string, false); - // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.VarDesc) - for (;;) { - ::std::pair<::google::protobuf::uint32, bool> p = - input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) - goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber( - tag)) { - // required string name = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_name())); - } else { - goto handle_unusual; - } - break; - } - - // required .paddle_mobile.framework.proto.VarType type = 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite:: - ReadMessageNoVirtual(input, mutable_type())); - } else { - goto handle_unusual; - } - break; - } - - // optional bool persistable = 3 [default = false]; - case 3: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { - set_has_persistable(); - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - bool, ::google::protobuf::internal::WireFormatLite:: - TYPE_BOOL>(input, &persistable_))); - } else { - goto handle_unusual; - } - break; - } + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ + goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::NewPermanentCallback( + &_internal_metadata_, + &::google::protobuf::internal::InternalMetadataWithArenaLite:: + mutable_unknown_fields)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.VarDesc) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = + input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) + goto handle_unusual; + switch ( + ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required string name = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + } else { + goto handle_unusual; + } + break; + } - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } - } + // required .paddle_mobile.framework.proto.VarType type = 2; + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_type())); + } else { + goto handle_unusual; + } + break; } + + // optional bool persistable = 3 [default = false]; + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(24u /* 24 & 0xFF */)) { + set_has_persistable(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &persistable_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } success: - // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.VarDesc) - return true; + // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.VarDesc) + return true; failure: - // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.VarDesc) - return false; + // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.VarDesc) + return false; #undef DO_ } void VarDesc::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream *output) const { - // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.VarDesc) - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _has_bits_[0]; - // required string name = 1; - if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( - 1, this->name(), output); - } - - // required .paddle_mobile.framework.proto.VarType type = 2; - if (cached_has_bits & 0x00000002u) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 2, *this->type_, output); - } - - // optional bool persistable = 3 [default = false]; - if (cached_has_bits & 0x00000004u) { - ::google::protobuf::internal::WireFormatLite::WriteBool( - 3, this->persistable(), output); - } - - output->WriteRaw( - _internal_metadata_.unknown_fields().data(), - static_cast(_internal_metadata_.unknown_fields().size())); - // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.VarDesc) + // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.VarDesc) + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required string name = 1; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // required .paddle_mobile.framework.proto.VarType type = 2; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormatLite::WriteMessage(2, *this->type_, + output); + } + + // optional bool persistable = 3 [default = false]; + if (cached_has_bits & 0x00000004u) { + ::google::protobuf::internal::WireFormatLite::WriteBool( + 3, this->persistable(), output); + } + + output->WriteRaw( + _internal_metadata_.unknown_fields().data(), + static_cast(_internal_metadata_.unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.VarDesc) } size_t VarDesc::RequiredFieldsByteSizeFallback() const { - // @@protoc_insertion_point(required_fields_byte_size_fallback_start:paddle_mobile.framework.proto.VarDesc) - size_t total_size = 0; + // @@protoc_insertion_point(required_fields_byte_size_fallback_start:paddle_mobile.framework.proto.VarDesc) + size_t total_size = 0; - if (has_name()) { - // required string name = 1; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->name()); - } + if (has_name()) { + // required string name = 1; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } - if (has_type()) { - // required .paddle_mobile.framework.proto.VarType type = 2; - total_size += - 1 + - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + if (has_type()) { + // required .paddle_mobile.framework.proto.VarType type = 2; + total_size += + 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( *this->type_); - } + } - return total_size; + return total_size; } size_t VarDesc::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.VarDesc) - size_t total_size = 0; - - total_size += _internal_metadata_.unknown_fields().size(); - - if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == - 0) { // All required fields are present. - // required string name = 1; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::StringSize( - this->name()); - - // required .paddle_mobile.framework.proto.VarType type = 2; - total_size += - 1 + - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.VarDesc) + size_t total_size = 0; + + total_size += _internal_metadata_.unknown_fields().size(); + + if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == + 0) { // All required fields are present. + // required string name = 1; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + + // required .paddle_mobile.framework.proto.VarType type = 2; + total_size += + 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( *this->type_); - } else { - total_size += RequiredFieldsByteSizeFallback(); - } - // optional bool persistable = 3 [default = false]; - if (has_persistable()) { - total_size += 1 + 1; - } + } else { + total_size += RequiredFieldsByteSizeFallback(); + } + // optional bool persistable = 3 [default = false]; + if (has_persistable()) { + total_size += 1 + 1; + } - int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; } void VarDesc::CheckTypeAndMergeFrom( const ::google::protobuf::MessageLite &from) { - MergeFrom(*::google::protobuf::down_cast(&from)); + MergeFrom(*::google::protobuf::down_cast(&from)); } void VarDesc::MergeFrom(const VarDesc &from) { - // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.VarDesc) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = from._has_bits_[0]; - if (cached_has_bits & 7u) { - if (cached_has_bits & 0x00000001u) { - set_has_name(); - name_.AssignWithDefault( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - from.name_); - } - if (cached_has_bits & 0x00000002u) { - mutable_type() - ->::paddle_mobile::framework::proto::VarType::MergeFrom( - from.type()); - } - if (cached_has_bits & 0x00000004u) { - persistable_ = from.persistable_; - } - _has_bits_[0] |= cached_has_bits; + // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.VarDesc) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 7u) { + if (cached_has_bits & 0x00000001u) { + set_has_name(); + name_.AssignWithDefault( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + from.name_); } + if (cached_has_bits & 0x00000002u) { + mutable_type()->::paddle_mobile::framework::proto::VarType::MergeFrom( + from.type()); + } + if (cached_has_bits & 0x00000004u) { + persistable_ = from.persistable_; + } + _has_bits_[0] |= cached_has_bits; + } } void VarDesc::CopyFrom(const VarDesc &from) { - // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarDesc) - if (&from == this) - return; - Clear(); - MergeFrom(from); + // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.VarDesc) + if (&from == this) + return; + Clear(); + MergeFrom(from); } bool VarDesc::IsInitialized() const { - if ((_has_bits_[0] & 0x00000003) != 0x00000003) - return false; - if (has_type()) { - if (!this->type_->IsInitialized()) - return false; - } - return true; + if ((_has_bits_[0] & 0x00000003) != 0x00000003) + return false; + if (has_type()) { + if (!this->type_->IsInitialized()) + return false; + } + return true; } void VarDesc::Swap(VarDesc *other) { - if (other == this) - return; - InternalSwap(other); + if (other == this) + return; + InternalSwap(other); } void VarDesc::InternalSwap(VarDesc *other) { - using std::swap; - name_.Swap(&other->name_); - swap(type_, other->type_); - swap(persistable_, other->persistable_); - swap(_has_bits_[0], other->_has_bits_[0]); - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); + using std::swap; + name_.Swap(&other->name_); + swap(type_, other->type_); + swap(persistable_, other->persistable_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); } ::std::string VarDesc::GetTypeName() const { - return "paddle_mobile.framework.proto.VarDesc"; + return "paddle_mobile.framework.proto.VarDesc"; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -7259,65 +7166,62 @@ bool VarDesc::has_name() const { return (_has_bits_[0] & 0x00000001u) != 0; } void VarDesc::set_has_name() { _has_bits_[0] |= 0x00000001u; } void VarDesc::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } void VarDesc::clear_name() { - name_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_name(); + name_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); } const ::std::string &VarDesc::name() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarDesc.name) - return name_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarDesc.name) + return name_.GetNoArena(); } void VarDesc::set_name(const ::std::string &value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarDesc.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarDesc.name) } #if LANG_CXX11 void VarDesc::set_name(::std::string &&value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.VarDesc.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.VarDesc.name) } #endif void VarDesc::set_name(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.VarDesc.name) + GOOGLE_DCHECK(value != NULL); + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.VarDesc.name) } void VarDesc::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:paddle_mobile.framework.proto.VarDesc.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.VarDesc.name) } ::std::string *VarDesc::mutable_name() { - set_has_name(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarDesc.name) - return name_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_name(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarDesc.name) + return name_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } ::std::string *VarDesc::release_name() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarDesc.name) - clear_has_name(); - return name_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarDesc.name) + clear_has_name(); + return name_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } void VarDesc::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:paddle_mobile.framework.proto.VarDesc.name) + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarDesc.name) } // required .paddle_mobile.framework.proto.VarType type = 2; @@ -7325,69 +7229,69 @@ bool VarDesc::has_type() const { return (_has_bits_[0] & 0x00000002u) != 0; } void VarDesc::set_has_type() { _has_bits_[0] |= 0x00000002u; } void VarDesc::clear_has_type() { _has_bits_[0] &= ~0x00000002u; } void VarDesc::clear_type() { - if (type_ != NULL) - type_->::paddle_mobile::framework::proto::VarType::Clear(); - clear_has_type(); + if (type_ != NULL) + type_->::paddle_mobile::framework::proto::VarType::Clear(); + clear_has_type(); } const ::paddle_mobile::framework::proto::VarType &VarDesc::type() const { - const ::paddle_mobile::framework::proto::VarType *p = type_; - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarDesc.type) - return p != NULL ? *p - : *reinterpret_cast< - const ::paddle_mobile::framework::proto::VarType *>( - &::paddle_mobile::framework::proto:: - _VarType_default_instance_); + const ::paddle_mobile::framework::proto::VarType *p = type_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarDesc.type) + return p != NULL ? *p + : *reinterpret_cast< + const ::paddle_mobile::framework::proto::VarType *>( + &::paddle_mobile::framework::proto:: + _VarType_default_instance_); } ::paddle_mobile::framework::proto::VarType *VarDesc::mutable_type() { - set_has_type(); - if (type_ == NULL) { - type_ = new ::paddle_mobile::framework::proto::VarType; - } - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarDesc.type) - return type_; + set_has_type(); + if (type_ == NULL) { + type_ = new ::paddle_mobile::framework::proto::VarType; + } + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarDesc.type) + return type_; } ::paddle_mobile::framework::proto::VarType *VarDesc::release_type() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarDesc.type) - clear_has_type(); - ::paddle_mobile::framework::proto::VarType *temp = type_; - type_ = NULL; - return temp; + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarDesc.type) + clear_has_type(); + ::paddle_mobile::framework::proto::VarType *temp = type_; + type_ = NULL; + return temp; } void VarDesc::set_allocated_type( ::paddle_mobile::framework::proto::VarType *type) { - delete type_; - type_ = type; - if (type) { - set_has_type(); - } else { - clear_has_type(); - } - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarDesc.type) + delete type_; + type_ = type; + if (type) { + set_has_type(); + } else { + clear_has_type(); + } + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarDesc.type) } // optional bool persistable = 3 [default = false]; bool VarDesc::has_persistable() const { - return (_has_bits_[0] & 0x00000004u) != 0; + return (_has_bits_[0] & 0x00000004u) != 0; } void VarDesc::set_has_persistable() { _has_bits_[0] |= 0x00000004u; } void VarDesc::clear_has_persistable() { _has_bits_[0] &= ~0x00000004u; } void VarDesc::clear_persistable() { - persistable_ = false; - clear_has_persistable(); + persistable_ = false; + clear_has_persistable(); } bool VarDesc::persistable() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarDesc.persistable) - return persistable_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarDesc.persistable) + return persistable_; } void VarDesc::set_persistable(bool value) { - set_has_persistable(); - persistable_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarDesc.persistable) + set_has_persistable(); + persistable_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarDesc.persistable) } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS - // =================================================================== + // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int BlockDesc::kIdxFieldNumber; @@ -7399,378 +7303,372 @@ const int BlockDesc::kForwardBlockIdxFieldNumber; BlockDesc::BlockDesc() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_framework_2eproto::InitDefaults(); - } - SharedCtor(); - // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.BlockDesc) + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + protobuf_framework_2eproto::InitDefaults(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.BlockDesc) } BlockDesc::BlockDesc(const BlockDesc &from) : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0), vars_(from.vars_), ops_(from.ops_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::memcpy(&idx_, &from.idx_, - static_cast(reinterpret_cast(&forward_block_idx_) - - reinterpret_cast(&idx_)) + - sizeof(forward_block_idx_)); - // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.BlockDesc) + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::memcpy(&idx_, &from.idx_, + static_cast(reinterpret_cast(&forward_block_idx_) - + reinterpret_cast(&idx_)) + + sizeof(forward_block_idx_)); + // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.BlockDesc) } void BlockDesc::SharedCtor() { - _cached_size_ = 0; - ::memset(&idx_, 0, - static_cast(reinterpret_cast(&parent_idx_) - - reinterpret_cast(&idx_)) + - sizeof(parent_idx_)); - forward_block_idx_ = -1; + _cached_size_ = 0; + ::memset(&idx_, 0, + static_cast(reinterpret_cast(&parent_idx_) - + reinterpret_cast(&idx_)) + + sizeof(parent_idx_)); + forward_block_idx_ = -1; } BlockDesc::~BlockDesc() { - // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.BlockDesc) - SharedDtor(); + // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.BlockDesc) + SharedDtor(); } void BlockDesc::SharedDtor() {} void BlockDesc::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const BlockDesc &BlockDesc::default_instance() { - protobuf_framework_2eproto::InitDefaults(); - return *internal_default_instance(); + protobuf_framework_2eproto::InitDefaults(); + return *internal_default_instance(); } BlockDesc *BlockDesc::New(::google::protobuf::Arena *arena) const { - BlockDesc *n = new BlockDesc; - if (arena != NULL) { - arena->Own(n); - } - return n; + BlockDesc *n = new BlockDesc; + if (arena != NULL) { + arena->Own(n); + } + return n; } void BlockDesc::Clear() { - // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.BlockDesc) - ::google::protobuf::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void)cached_has_bits; - - vars_.Clear(); - ops_.Clear(); - cached_has_bits = _has_bits_[0]; - if (cached_has_bits & 7u) { - ::memset(&idx_, 0, - static_cast(reinterpret_cast(&parent_idx_) - - reinterpret_cast(&idx_)) + - sizeof(parent_idx_)); - forward_block_idx_ = -1; - } - _has_bits_.Clear(); - _internal_metadata_.Clear(); + // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.BlockDesc) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + vars_.Clear(); + ops_.Clear(); + cached_has_bits = _has_bits_[0]; + if (cached_has_bits & 7u) { + ::memset(&idx_, 0, + static_cast(reinterpret_cast(&parent_idx_) - + reinterpret_cast(&idx_)) + + sizeof(parent_idx_)); + forward_block_idx_ = -1; + } + _has_bits_.Clear(); + _internal_metadata_.Clear(); } bool BlockDesc::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::NewPermanentCallback( - &_internal_metadata_, - &::google::protobuf::internal::InternalMetadataWithArenaLite:: - mutable_unknown_fields)); - ::google::protobuf::io::CodedOutputStream unknown_fields_stream( - &unknown_fields_string, false); - // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.BlockDesc) - for (;;) { - ::std::pair<::google::protobuf::uint32, bool> p = - input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) - goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber( - tag)) { - // required int32 idx = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { - set_has_idx(); - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int32, - ::google::protobuf::internal::WireFormatLite:: - TYPE_INT32>(input, &idx_))); - } else { - goto handle_unusual; - } - break; - } - - // required int32 parent_idx = 2; - case 2: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { - set_has_parent_idx(); - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int32, - ::google::protobuf::internal::WireFormatLite:: - TYPE_INT32>(input, &parent_idx_))); - } else { - goto handle_unusual; - } - break; - } - - // repeated .paddle_mobile.framework.proto.VarDesc vars = 3; - case 3: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite:: - ReadMessageNoVirtual(input, add_vars())); - } else { - goto handle_unusual; - } - break; - } - - // repeated .paddle_mobile.framework.proto.OpDesc ops = 4; - case 4: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite:: - ReadMessageNoVirtual(input, add_ops())); - } else { - goto handle_unusual; - } - break; - } - - // optional int32 forward_block_idx = 5 [default = -1]; - case 5: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { - set_has_forward_block_idx(); - DO_(( - ::google::protobuf::internal::WireFormatLite::ReadPrimitive< - ::google::protobuf::int32, - ::google::protobuf::internal::WireFormatLite:: - TYPE_INT32>(input, &forward_block_idx_))); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } - } - } -success: - // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.BlockDesc) - return true; -failure: - // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.BlockDesc) - return false; -#undef DO_ -} - -void BlockDesc::SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream *output) const { - // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.BlockDesc) - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - cached_has_bits = _has_bits_[0]; + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ + goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::NewPermanentCallback( + &_internal_metadata_, + &::google::protobuf::internal::InternalMetadataWithArenaLite:: + mutable_unknown_fields)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.BlockDesc) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = + input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) + goto handle_unusual; + switch ( + ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required int32 idx = 1; - if (cached_has_bits & 0x00000001u) { - ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->idx(), - output); + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { + set_has_idx(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, + ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(input, + &idx_))); + } else { + goto handle_unusual; + } + break; } // required int32 parent_idx = 2; - if (cached_has_bits & 0x00000002u) { - ::google::protobuf::internal::WireFormatLite::WriteInt32( - 2, this->parent_idx(), output); + case 2: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) { + set_has_parent_idx(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, + ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &parent_idx_))); + } else { + goto handle_unusual; + } + break; } // repeated .paddle_mobile.framework.proto.VarDesc vars = 3; - for (unsigned int i = 0, n = static_cast(this->vars_size()); - i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 3, this->vars(static_cast(i)), output); + case 3: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_vars())); + } else { + goto handle_unusual; + } + break; } // repeated .paddle_mobile.framework.proto.OpDesc ops = 4; - for (unsigned int i = 0, n = static_cast(this->ops_size()); - i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 4, this->ops(static_cast(i)), output); + case 4: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(34u /* 34 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_ops())); + } else { + goto handle_unusual; + } + break; } // optional int32 forward_block_idx = 5 [default = -1]; - if (cached_has_bits & 0x00000004u) { - ::google::protobuf::internal::WireFormatLite::WriteInt32( - 5, this->forward_block_idx(), output); - } + case 5: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(40u /* 40 & 0xFF */)) { + set_has_forward_block_idx(); + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, + ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &forward_block_idx_))); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.BlockDesc) + return true; +failure: + // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.BlockDesc) + return false; +#undef DO_ +} - output->WriteRaw( - _internal_metadata_.unknown_fields().data(), - static_cast(_internal_metadata_.unknown_fields().size())); - // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.BlockDesc) +void BlockDesc::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream *output) const { + // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.BlockDesc) + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = _has_bits_[0]; + // required int32 idx = 1; + if (cached_has_bits & 0x00000001u) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->idx(), + output); + } + + // required int32 parent_idx = 2; + if (cached_has_bits & 0x00000002u) { + ::google::protobuf::internal::WireFormatLite::WriteInt32( + 2, this->parent_idx(), output); + } + + // repeated .paddle_mobile.framework.proto.VarDesc vars = 3; + for (unsigned int i = 0, n = static_cast(this->vars_size()); + i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 3, this->vars(static_cast(i)), output); + } + + // repeated .paddle_mobile.framework.proto.OpDesc ops = 4; + for (unsigned int i = 0, n = static_cast(this->ops_size()); + i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 4, this->ops(static_cast(i)), output); + } + + // optional int32 forward_block_idx = 5 [default = -1]; + if (cached_has_bits & 0x00000004u) { + ::google::protobuf::internal::WireFormatLite::WriteInt32( + 5, this->forward_block_idx(), output); + } + + output->WriteRaw( + _internal_metadata_.unknown_fields().data(), + static_cast(_internal_metadata_.unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.BlockDesc) } size_t BlockDesc::RequiredFieldsByteSizeFallback() const { - // @@protoc_insertion_point(required_fields_byte_size_fallback_start:paddle_mobile.framework.proto.BlockDesc) - size_t total_size = 0; + // @@protoc_insertion_point(required_fields_byte_size_fallback_start:paddle_mobile.framework.proto.BlockDesc) + size_t total_size = 0; - if (has_idx()) { - // required int32 idx = 1; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( - this->idx()); - } + if (has_idx()) { + // required int32 idx = 1; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->idx()); + } - if (has_parent_idx()) { - // required int32 parent_idx = 2; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( - this->parent_idx()); - } + if (has_parent_idx()) { + // required int32 parent_idx = 2; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->parent_idx()); + } - return total_size; + return total_size; } size_t BlockDesc::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.BlockDesc) - size_t total_size = 0; - - total_size += _internal_metadata_.unknown_fields().size(); - - if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == - 0) { // All required fields are present. - // required int32 idx = 1; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( - this->idx()); - - // required int32 parent_idx = 2; - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( - this->parent_idx()); - - } else { - total_size += RequiredFieldsByteSizeFallback(); - } - // repeated .paddle_mobile.framework.proto.VarDesc vars = 3; - { - unsigned int count = static_cast(this->vars_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += ::google::protobuf::internal::WireFormatLite:: - MessageSizeNoVirtual(this->vars(static_cast(i))); - } - } + // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.BlockDesc) + size_t total_size = 0; - // repeated .paddle_mobile.framework.proto.OpDesc ops = 4; - { - unsigned int count = static_cast(this->ops_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += ::google::protobuf::internal::WireFormatLite:: - MessageSizeNoVirtual(this->ops(static_cast(i))); - } - } + total_size += _internal_metadata_.unknown_fields().size(); - // optional int32 forward_block_idx = 5 [default = -1]; - if (has_forward_block_idx()) { - total_size += - 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( - this->forward_block_idx()); - } + if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == + 0) { // All required fields are present. + // required int32 idx = 1; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->idx()); - int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; + // required int32 parent_idx = 2; + total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->parent_idx()); + + } else { + total_size += RequiredFieldsByteSizeFallback(); + } + // repeated .paddle_mobile.framework.proto.VarDesc vars = 3; + { + unsigned int count = static_cast(this->vars_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->vars(static_cast(i))); + } + } + + // repeated .paddle_mobile.framework.proto.OpDesc ops = 4; + { + unsigned int count = static_cast(this->ops_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->ops(static_cast(i))); + } + } + + // optional int32 forward_block_idx = 5 [default = -1]; + if (has_forward_block_idx()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->forward_block_idx()); + } + + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; } void BlockDesc::CheckTypeAndMergeFrom( const ::google::protobuf::MessageLite &from) { - MergeFrom(*::google::protobuf::down_cast(&from)); + MergeFrom(*::google::protobuf::down_cast(&from)); } void BlockDesc::MergeFrom(const BlockDesc &from) { - // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.BlockDesc) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; - - vars_.MergeFrom(from.vars_); - ops_.MergeFrom(from.ops_); - cached_has_bits = from._has_bits_[0]; - if (cached_has_bits & 7u) { - if (cached_has_bits & 0x00000001u) { - idx_ = from.idx_; - } - if (cached_has_bits & 0x00000002u) { - parent_idx_ = from.parent_idx_; - } - if (cached_has_bits & 0x00000004u) { - forward_block_idx_ = from.forward_block_idx_; - } - _has_bits_[0] |= cached_has_bits; + // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.BlockDesc) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; + + vars_.MergeFrom(from.vars_); + ops_.MergeFrom(from.ops_); + cached_has_bits = from._has_bits_[0]; + if (cached_has_bits & 7u) { + if (cached_has_bits & 0x00000001u) { + idx_ = from.idx_; + } + if (cached_has_bits & 0x00000002u) { + parent_idx_ = from.parent_idx_; } + if (cached_has_bits & 0x00000004u) { + forward_block_idx_ = from.forward_block_idx_; + } + _has_bits_[0] |= cached_has_bits; + } } void BlockDesc::CopyFrom(const BlockDesc &from) { - // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.BlockDesc) - if (&from == this) - return; - Clear(); - MergeFrom(from); + // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.BlockDesc) + if (&from == this) + return; + Clear(); + MergeFrom(from); } bool BlockDesc::IsInitialized() const { - if ((_has_bits_[0] & 0x00000003) != 0x00000003) - return false; - if (!::google::protobuf::internal::AllAreInitialized(this->vars())) - return false; - if (!::google::protobuf::internal::AllAreInitialized(this->ops())) - return false; - return true; + if ((_has_bits_[0] & 0x00000003) != 0x00000003) + return false; + if (!::google::protobuf::internal::AllAreInitialized(this->vars())) + return false; + if (!::google::protobuf::internal::AllAreInitialized(this->ops())) + return false; + return true; } void BlockDesc::Swap(BlockDesc *other) { - if (other == this) - return; - InternalSwap(other); + if (other == this) + return; + InternalSwap(other); } void BlockDesc::InternalSwap(BlockDesc *other) { - using std::swap; - vars_.InternalSwap(&other->vars_); - ops_.InternalSwap(&other->ops_); - swap(idx_, other->idx_); - swap(parent_idx_, other->parent_idx_); - swap(forward_block_idx_, other->forward_block_idx_); - swap(_has_bits_[0], other->_has_bits_[0]); - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); + using std::swap; + vars_.InternalSwap(&other->vars_); + ops_.InternalSwap(&other->ops_); + swap(idx_, other->idx_); + swap(parent_idx_, other->parent_idx_); + swap(forward_block_idx_, other->forward_block_idx_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); } ::std::string BlockDesc::GetTypeName() const { - return "paddle_mobile.framework.proto.BlockDesc"; + return "paddle_mobile.framework.proto.BlockDesc"; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -7781,37 +7679,37 @@ bool BlockDesc::has_idx() const { return (_has_bits_[0] & 0x00000001u) != 0; } void BlockDesc::set_has_idx() { _has_bits_[0] |= 0x00000001u; } void BlockDesc::clear_has_idx() { _has_bits_[0] &= ~0x00000001u; } void BlockDesc::clear_idx() { - idx_ = 0; - clear_has_idx(); + idx_ = 0; + clear_has_idx(); } ::google::protobuf::int32 BlockDesc::idx() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.idx) - return idx_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.idx) + return idx_; } void BlockDesc::set_idx(::google::protobuf::int32 value) { - set_has_idx(); - idx_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.BlockDesc.idx) + set_has_idx(); + idx_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.BlockDesc.idx) } // required int32 parent_idx = 2; bool BlockDesc::has_parent_idx() const { - return (_has_bits_[0] & 0x00000002u) != 0; + return (_has_bits_[0] & 0x00000002u) != 0; } void BlockDesc::set_has_parent_idx() { _has_bits_[0] |= 0x00000002u; } void BlockDesc::clear_has_parent_idx() { _has_bits_[0] &= ~0x00000002u; } void BlockDesc::clear_parent_idx() { - parent_idx_ = 0; - clear_has_parent_idx(); + parent_idx_ = 0; + clear_has_parent_idx(); } ::google::protobuf::int32 BlockDesc::parent_idx() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.parent_idx) - return parent_idx_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.parent_idx) + return parent_idx_; } void BlockDesc::set_parent_idx(::google::protobuf::int32 value) { - set_has_parent_idx(); - parent_idx_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.BlockDesc.parent_idx) + set_has_parent_idx(); + parent_idx_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.BlockDesc.parent_idx) } // repeated .paddle_mobile.framework.proto.VarDesc vars = 3; @@ -7819,27 +7717,27 @@ int BlockDesc::vars_size() const { return vars_.size(); } void BlockDesc::clear_vars() { vars_.Clear(); } const ::paddle_mobile::framework::proto::VarDesc & BlockDesc::vars(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.vars) - return vars_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.vars) + return vars_.Get(index); } ::paddle_mobile::framework::proto::VarDesc *BlockDesc::mutable_vars(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.BlockDesc.vars) - return vars_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.BlockDesc.vars) + return vars_.Mutable(index); } ::paddle_mobile::framework::proto::VarDesc *BlockDesc::add_vars() { - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.BlockDesc.vars) - return vars_.Add(); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.BlockDesc.vars) + return vars_.Add(); } ::google::protobuf::RepeatedPtrField<::paddle_mobile::framework::proto::VarDesc> *BlockDesc::mutable_vars() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.BlockDesc.vars) - return &vars_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.BlockDesc.vars) + return &vars_; } const ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::VarDesc> & BlockDesc::vars() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.BlockDesc.vars) - return vars_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.BlockDesc.vars) + return vars_; } // repeated .paddle_mobile.framework.proto.OpDesc ops = 4; @@ -7847,52 +7745,52 @@ int BlockDesc::ops_size() const { return ops_.size(); } void BlockDesc::clear_ops() { ops_.Clear(); } const ::paddle_mobile::framework::proto::OpDesc & BlockDesc::ops(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.ops) - return ops_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.ops) + return ops_.Get(index); } ::paddle_mobile::framework::proto::OpDesc *BlockDesc::mutable_ops(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.BlockDesc.ops) - return ops_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.BlockDesc.ops) + return ops_.Mutable(index); } ::paddle_mobile::framework::proto::OpDesc *BlockDesc::add_ops() { - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.BlockDesc.ops) - return ops_.Add(); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.BlockDesc.ops) + return ops_.Add(); } ::google::protobuf::RepeatedPtrField<::paddle_mobile::framework::proto::OpDesc> *BlockDesc::mutable_ops() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.BlockDesc.ops) - return &ops_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.BlockDesc.ops) + return &ops_; } const ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpDesc> & BlockDesc::ops() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.BlockDesc.ops) - return ops_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.BlockDesc.ops) + return ops_; } // optional int32 forward_block_idx = 5 [default = -1]; bool BlockDesc::has_forward_block_idx() const { - return (_has_bits_[0] & 0x00000004u) != 0; + return (_has_bits_[0] & 0x00000004u) != 0; } void BlockDesc::set_has_forward_block_idx() { _has_bits_[0] |= 0x00000004u; } void BlockDesc::clear_has_forward_block_idx() { _has_bits_[0] &= ~0x00000004u; } void BlockDesc::clear_forward_block_idx() { - forward_block_idx_ = -1; - clear_has_forward_block_idx(); + forward_block_idx_ = -1; + clear_has_forward_block_idx(); } ::google::protobuf::int32 BlockDesc::forward_block_idx() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.forward_block_idx) - return forward_block_idx_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.forward_block_idx) + return forward_block_idx_; } void BlockDesc::set_forward_block_idx(::google::protobuf::int32 value) { - set_has_forward_block_idx(); - forward_block_idx_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.BlockDesc.forward_block_idx) + set_has_forward_block_idx(); + forward_block_idx_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.BlockDesc.forward_block_idx) } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS - // =================================================================== + // =================================================================== #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int ProgramDesc::kBlocksFieldNumber; @@ -7900,198 +7798,199 @@ const int ProgramDesc::kBlocksFieldNumber; ProgramDesc::ProgramDesc() : ::google::protobuf::MessageLite(), _internal_metadata_(NULL) { - if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { - protobuf_framework_2eproto::InitDefaults(); - } - SharedCtor(); - // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.ProgramDesc) + if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { + protobuf_framework_2eproto::InitDefaults(); + } + SharedCtor(); + // @@protoc_insertion_point(constructor:paddle_mobile.framework.proto.ProgramDesc) } ProgramDesc::ProgramDesc(const ProgramDesc &from) : ::google::protobuf::MessageLite(), _internal_metadata_(NULL), _has_bits_(from._has_bits_), _cached_size_(0), blocks_(from.blocks_) { - _internal_metadata_.MergeFrom(from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.ProgramDesc) + _internal_metadata_.MergeFrom(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:paddle_mobile.framework.proto.ProgramDesc) } void ProgramDesc::SharedCtor() { _cached_size_ = 0; } ProgramDesc::~ProgramDesc() { - // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.ProgramDesc) - SharedDtor(); + // @@protoc_insertion_point(destructor:paddle_mobile.framework.proto.ProgramDesc) + SharedDtor(); } void ProgramDesc::SharedDtor() {} void ProgramDesc::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); } const ProgramDesc &ProgramDesc::default_instance() { - protobuf_framework_2eproto::InitDefaults(); - return *internal_default_instance(); + protobuf_framework_2eproto::InitDefaults(); + return *internal_default_instance(); } ProgramDesc *ProgramDesc::New(::google::protobuf::Arena *arena) const { - ProgramDesc *n = new ProgramDesc; - if (arena != NULL) { - arena->Own(n); - } - return n; + ProgramDesc *n = new ProgramDesc; + if (arena != NULL) { + arena->Own(n); + } + return n; } void ProgramDesc::Clear() { - // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.ProgramDesc) - ::google::protobuf::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void)cached_has_bits; + // @@protoc_insertion_point(message_clear_start:paddle_mobile.framework.proto.ProgramDesc) + ::google::protobuf::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; - blocks_.Clear(); - _has_bits_.Clear(); - _internal_metadata_.Clear(); + blocks_.Clear(); + _has_bits_.Clear(); + _internal_metadata_.Clear(); } bool ProgramDesc::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::NewPermanentCallback( - &_internal_metadata_, - &::google::protobuf::internal::InternalMetadataWithArenaLite:: - mutable_unknown_fields)); - ::google::protobuf::io::CodedOutputStream unknown_fields_stream( - &unknown_fields_string, false); - // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.ProgramDesc) - for (;;) { - ::std::pair<::google::protobuf::uint32, bool> p = - input->ReadTagWithCutoffNoLastTag(127u); - tag = p.first; - if (!p.second) - goto handle_unusual; - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber( - tag)) { - // repeated .paddle_mobile.framework.proto.BlockDesc blocks - // = 1; - case 1: { - if (static_cast<::google::protobuf::uint8>(tag) == - static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { - DO_(::google::protobuf::internal::WireFormatLite:: - ReadMessageNoVirtual(input, add_blocks())); - } else { - goto handle_unusual; - } - break; - } - - default: { - handle_unusual: - if (tag == 0) { - goto success; - } - DO_(::google::protobuf::internal::WireFormatLite::SkipField( - input, tag, &unknown_fields_stream)); - break; - } - } - } + if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \ + goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::LazyStringOutputStream unknown_fields_string( + ::google::protobuf::NewPermanentCallback( + &_internal_metadata_, + &::google::protobuf::internal::InternalMetadataWithArenaLite:: + mutable_unknown_fields)); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string, false); + // @@protoc_insertion_point(parse_start:paddle_mobile.framework.proto.ProgramDesc) + for (;;) { + ::std::pair<::google::protobuf::uint32, bool> p = + input->ReadTagWithCutoffNoLastTag(127u); + tag = p.first; + if (!p.second) + goto handle_unusual; + switch ( + ::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .paddle_mobile.framework.proto.BlockDesc blocks + // = 1; + case 1: { + if (static_cast<::google::protobuf::uint8>(tag) == + static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_blocks())); + } else { + goto handle_unusual; + } + break; + } + + default: { + handle_unusual: + if (tag == 0) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } success: - // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.ProgramDesc) - return true; + // @@protoc_insertion_point(parse_success:paddle_mobile.framework.proto.ProgramDesc) + return true; failure: - // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.ProgramDesc) - return false; + // @@protoc_insertion_point(parse_failure:paddle_mobile.framework.proto.ProgramDesc) + return false; #undef DO_ } void ProgramDesc::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream *output) const { - // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.ProgramDesc) - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; + // @@protoc_insertion_point(serialize_start:paddle_mobile.framework.proto.ProgramDesc) + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; - // repeated .paddle_mobile.framework.proto.BlockDesc blocks = 1; - for (unsigned int i = 0, n = static_cast(this->blocks_size()); - i < n; i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessage( - 1, this->blocks(static_cast(i)), output); - } + // repeated .paddle_mobile.framework.proto.BlockDesc blocks = 1; + for (unsigned int i = 0, n = static_cast(this->blocks_size()); + i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, this->blocks(static_cast(i)), output); + } - output->WriteRaw( - _internal_metadata_.unknown_fields().data(), - static_cast(_internal_metadata_.unknown_fields().size())); - // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.ProgramDesc) + output->WriteRaw( + _internal_metadata_.unknown_fields().data(), + static_cast(_internal_metadata_.unknown_fields().size())); + // @@protoc_insertion_point(serialize_end:paddle_mobile.framework.proto.ProgramDesc) } size_t ProgramDesc::ByteSizeLong() const { - // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.ProgramDesc) - size_t total_size = 0; - - total_size += _internal_metadata_.unknown_fields().size(); - - // repeated .paddle_mobile.framework.proto.BlockDesc blocks = 1; - { - unsigned int count = static_cast(this->blocks_size()); - total_size += 1UL * count; - for (unsigned int i = 0; i < count; i++) { - total_size += ::google::protobuf::internal::WireFormatLite:: - MessageSizeNoVirtual(this->blocks(static_cast(i))); - } + // @@protoc_insertion_point(message_byte_size_start:paddle_mobile.framework.proto.ProgramDesc) + size_t total_size = 0; + + total_size += _internal_metadata_.unknown_fields().size(); + + // repeated .paddle_mobile.framework.proto.BlockDesc blocks = 1; + { + unsigned int count = static_cast(this->blocks_size()); + total_size += 1UL * count; + for (unsigned int i = 0; i < count; i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blocks(static_cast(i))); } + } - int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = cached_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; + int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = cached_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; } void ProgramDesc::CheckTypeAndMergeFrom( const ::google::protobuf::MessageLite &from) { - MergeFrom(*::google::protobuf::down_cast(&from)); + MergeFrom(*::google::protobuf::down_cast(&from)); } void ProgramDesc::MergeFrom(const ProgramDesc &from) { - // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.ProgramDesc) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom(from._internal_metadata_); - ::google::protobuf::uint32 cached_has_bits = 0; - (void)cached_has_bits; + // @@protoc_insertion_point(class_specific_merge_from_start:paddle_mobile.framework.proto.ProgramDesc) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom(from._internal_metadata_); + ::google::protobuf::uint32 cached_has_bits = 0; + (void)cached_has_bits; - blocks_.MergeFrom(from.blocks_); + blocks_.MergeFrom(from.blocks_); } void ProgramDesc::CopyFrom(const ProgramDesc &from) { - // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.ProgramDesc) - if (&from == this) - return; - Clear(); - MergeFrom(from); + // @@protoc_insertion_point(class_specific_copy_from_start:paddle_mobile.framework.proto.ProgramDesc) + if (&from == this) + return; + Clear(); + MergeFrom(from); } bool ProgramDesc::IsInitialized() const { - if (!::google::protobuf::internal::AllAreInitialized(this->blocks())) - return false; - return true; + if (!::google::protobuf::internal::AllAreInitialized(this->blocks())) + return false; + return true; } void ProgramDesc::Swap(ProgramDesc *other) { - if (other == this) - return; - InternalSwap(other); + if (other == this) + return; + InternalSwap(other); } void ProgramDesc::InternalSwap(ProgramDesc *other) { - using std::swap; - blocks_.InternalSwap(&other->blocks_); - swap(_has_bits_[0], other->_has_bits_[0]); - _internal_metadata_.Swap(&other->_internal_metadata_); - swap(_cached_size_, other->_cached_size_); + using std::swap; + blocks_.InternalSwap(&other->blocks_); + swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + swap(_cached_size_, other->_cached_size_); } ::std::string ProgramDesc::GetTypeName() const { - return "paddle_mobile.framework.proto.ProgramDesc"; + return "paddle_mobile.framework.proto.ProgramDesc"; } #if PROTOBUF_INLINE_NOT_IN_HEADERS @@ -8102,29 +8001,29 @@ int ProgramDesc::blocks_size() const { return blocks_.size(); } void ProgramDesc::clear_blocks() { blocks_.Clear(); } const ::paddle_mobile::framework::proto::BlockDesc & ProgramDesc::blocks(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.ProgramDesc.blocks) - return blocks_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.ProgramDesc.blocks) + return blocks_.Get(index); } ::paddle_mobile::framework::proto::BlockDesc * ProgramDesc::mutable_blocks(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.ProgramDesc.blocks) - return blocks_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.ProgramDesc.blocks) + return blocks_.Mutable(index); } ::paddle_mobile::framework::proto::BlockDesc *ProgramDesc::add_blocks() { - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.ProgramDesc.blocks) - return blocks_.Add(); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.ProgramDesc.blocks) + return blocks_.Add(); } ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::BlockDesc> * ProgramDesc::mutable_blocks() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.ProgramDesc.blocks) - return &blocks_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.ProgramDesc.blocks) + return &blocks_; } const ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::BlockDesc> & ProgramDesc::blocks() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.ProgramDesc.blocks) - return blocks_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.ProgramDesc.blocks) + return blocks_; } #endif // PROTOBUF_INLINE_NOT_IN_HEADERS diff --git a/src/framework/framework.pb.h b/src/framework/framework.pb.h index cb4bab0d852f44c4a61a9bd3eeed7cc96f2877eb..34a055d7c4be2935a877d2cb30ed77542df75c5c 100644 --- a/src/framework/framework.pb.h +++ b/src/framework/framework.pb.h @@ -97,39 +97,39 @@ namespace proto { namespace protobuf_framework_2eproto { // Internal implementation detail -- do not call these. struct TableStruct { - static const ::google::protobuf::internal::ParseTableField entries[]; - static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; - static const ::google::protobuf::internal::ParseTable schema[]; - static const ::google::protobuf::uint32 offsets[]; - static const ::google::protobuf::internal::FieldMetadata field_metadata[]; - static const ::google::protobuf::internal::SerializationTable - serialization_table[]; - static void InitDefaultsImpl(); + static const ::google::protobuf::internal::ParseTableField entries[]; + static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; + static const ::google::protobuf::internal::ParseTable schema[]; + static const ::google::protobuf::uint32 offsets[]; + static const ::google::protobuf::internal::FieldMetadata field_metadata[]; + static const ::google::protobuf::internal::SerializationTable + serialization_table[]; + static void InitDefaultsImpl(); }; void AddDescriptors(); void InitDefaults(); } // namespace protobuf_framework_2eproto enum VarType_Type { - VarType_Type_BOOL = 0, - VarType_Type_INT16 = 1, - VarType_Type_INT32 = 2, - VarType_Type_INT64 = 3, - VarType_Type_FP16 = 4, - VarType_Type_FP32 = 5, - VarType_Type_FP64 = 6, - VarType_Type_LOD_TENSOR = 7, - VarType_Type_SELECTED_ROWS = 8, - VarType_Type_FEED_MINIBATCH = 9, - VarType_Type_FETCH_LIST = 10, - VarType_Type_STEP_SCOPES = 11, - VarType_Type_LOD_RANK_TABLE = 12, - VarType_Type_LOD_TENSOR_ARRAY = 13, - VarType_Type_PLACE_LIST = 14, - VarType_Type_READER = 15, - VarType_Type_CHANNEL = 16, - VarType_Type_RAW = 17, - VarType_Type_TUPLE = 18 + VarType_Type_BOOL = 0, + VarType_Type_INT16 = 1, + VarType_Type_INT32 = 2, + VarType_Type_INT64 = 3, + VarType_Type_FP16 = 4, + VarType_Type_FP32 = 5, + VarType_Type_FP64 = 6, + VarType_Type_LOD_TENSOR = 7, + VarType_Type_SELECTED_ROWS = 8, + VarType_Type_FEED_MINIBATCH = 9, + VarType_Type_FETCH_LIST = 10, + VarType_Type_STEP_SCOPES = 11, + VarType_Type_LOD_RANK_TABLE = 12, + VarType_Type_LOD_TENSOR_ARRAY = 13, + VarType_Type_PLACE_LIST = 14, + VarType_Type_READER = 15, + VarType_Type_CHANNEL = 16, + VarType_Type_RAW = 17, + VarType_Type_TUPLE = 18 }; bool VarType_Type_IsValid(int value); const VarType_Type VarType_Type_Type_MIN = VarType_Type_BOOL; @@ -137,16 +137,16 @@ const VarType_Type VarType_Type_Type_MAX = VarType_Type_TUPLE; const int VarType_Type_Type_ARRAYSIZE = VarType_Type_Type_MAX + 1; enum AttrType { - INT = 0, - FLOAT = 1, - STRING = 2, - INTS = 3, - FLOATS = 4, - STRINGS = 5, - BOOLEAN = 6, - BOOLEANS = 7, - BLOCK = 8, - LONG = 9 + INT = 0, + FLOAT = 1, + STRING = 2, + INTS = 3, + FLOATS = 4, + STRINGS = 5, + BOOLEAN = 6, + BOOLEANS = 7, + BLOCK = 8, + LONG = 9 }; bool AttrType_IsValid(int value); const AttrType AttrType_MIN = INT; @@ -160,254 +160,253 @@ class OpDesc_Attr MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.OpDesc.Attr) */ { - public: - OpDesc_Attr(); - virtual ~OpDesc_Attr(); +public: + OpDesc_Attr(); + virtual ~OpDesc_Attr(); - OpDesc_Attr(const OpDesc_Attr &from); + OpDesc_Attr(const OpDesc_Attr &from); - inline OpDesc_Attr &operator=(const OpDesc_Attr &from) { - CopyFrom(from); - return *this; - } + inline OpDesc_Attr &operator=(const OpDesc_Attr &from) { + CopyFrom(from); + return *this; + } #if LANG_CXX11 - OpDesc_Attr(OpDesc_Attr &&from) noexcept : OpDesc_Attr() { - *this = ::std::move(from); - } - - inline OpDesc_Attr &operator=(OpDesc_Attr &&from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; + OpDesc_Attr(OpDesc_Attr &&from) noexcept : OpDesc_Attr() { + *this = ::std::move(from); + } + + inline OpDesc_Attr &operator=(OpDesc_Attr &&from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) + InternalSwap(&from); + } else { + CopyFrom(from); } + return *this; + } #endif - inline const ::std::string &unknown_fields() const { - return _internal_metadata_.unknown_fields(); - } - inline ::std::string *mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); - } - - static const OpDesc_Attr &default_instance(); - - static inline const OpDesc_Attr *internal_default_instance() { - return reinterpret_cast( - &_OpDesc_Attr_default_instance_); - } - static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 0; - - void Swap(OpDesc_Attr *other); - friend void swap(OpDesc_Attr &a, OpDesc_Attr &b) { a.Swap(&b); } - - // implements Message - // ---------------------------------------------- - - inline OpDesc_Attr *New() const PROTOBUF_FINAL { return New(NULL); } - - OpDesc_Attr *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; - void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) - PROTOBUF_FINAL; - void CopyFrom(const OpDesc_Attr &from); - void MergeFrom(const OpDesc_Attr &from); - void Clear() PROTOBUF_FINAL; - bool IsInitialized() const PROTOBUF_FINAL; - - size_t ByteSizeLong() const PROTOBUF_FINAL; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; - void DiscardUnknownFields(); - int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(OpDesc_Attr *other); - - private: - inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } - inline void *MaybeArenaPtr() const { return NULL; } - - public: - ::std::string GetTypeName() const PROTOBUF_FINAL; - - // nested types - // ---------------------------------------------------- - - // accessors - // ------------------------------------------------------- - - // repeated int32 ints = 6; - int ints_size() const; - void clear_ints(); - static const int kIntsFieldNumber = 6; - ::google::protobuf::int32 ints(int index) const; - void set_ints(int index, ::google::protobuf::int32 value); - void add_ints(::google::protobuf::int32 value); - const ::google::protobuf::RepeatedField<::google::protobuf::int32> & - ints() const; - ::google::protobuf::RepeatedField<::google::protobuf::int32> * - mutable_ints(); - - // repeated float floats = 7; - int floats_size() const; - void clear_floats(); - static const int kFloatsFieldNumber = 7; - float floats(int index) const; - void set_floats(int index, float value); - void add_floats(float value); - const ::google::protobuf::RepeatedField &floats() const; - ::google::protobuf::RepeatedField *mutable_floats(); - - // repeated string strings = 8; - int strings_size() const; - void clear_strings(); - static const int kStringsFieldNumber = 8; - const ::std::string &strings(int index) const; - ::std::string *mutable_strings(int index); - void set_strings(int index, const ::std::string &value); + inline const ::std::string &unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::std::string *mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const OpDesc_Attr &default_instance(); + + static inline const OpDesc_Attr *internal_default_instance() { + return reinterpret_cast( + &_OpDesc_Attr_default_instance_); + } + static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 0; + + void Swap(OpDesc_Attr *other); + friend void swap(OpDesc_Attr &a, OpDesc_Attr &b) { a.Swap(&b); } + + // implements Message + // ---------------------------------------------- + + inline OpDesc_Attr *New() const PROTOBUF_FINAL { return New(NULL); } + + OpDesc_Attr *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) + PROTOBUF_FINAL; + void CopyFrom(const OpDesc_Attr &from); + void MergeFrom(const OpDesc_Attr &from); + void Clear() PROTOBUF_FINAL; + bool IsInitialized() const PROTOBUF_FINAL; + + size_t ByteSizeLong() const PROTOBUF_FINAL; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; + void DiscardUnknownFields(); + int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } + +private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(OpDesc_Attr *other); + +private: + inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } + inline void *MaybeArenaPtr() const { return NULL; } + +public: + ::std::string GetTypeName() const PROTOBUF_FINAL; + + // nested types + // ---------------------------------------------------- + + // accessors + // ------------------------------------------------------- + + // repeated int32 ints = 6; + int ints_size() const; + void clear_ints(); + static const int kIntsFieldNumber = 6; + ::google::protobuf::int32 ints(int index) const; + void set_ints(int index, ::google::protobuf::int32 value); + void add_ints(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField<::google::protobuf::int32> & + ints() const; + ::google::protobuf::RepeatedField<::google::protobuf::int32> *mutable_ints(); + + // repeated float floats = 7; + int floats_size() const; + void clear_floats(); + static const int kFloatsFieldNumber = 7; + float floats(int index) const; + void set_floats(int index, float value); + void add_floats(float value); + const ::google::protobuf::RepeatedField &floats() const; + ::google::protobuf::RepeatedField *mutable_floats(); + + // repeated string strings = 8; + int strings_size() const; + void clear_strings(); + static const int kStringsFieldNumber = 8; + const ::std::string &strings(int index) const; + ::std::string *mutable_strings(int index); + void set_strings(int index, const ::std::string &value); #if LANG_CXX11 - void set_strings(int index, ::std::string &&value); + void set_strings(int index, ::std::string &&value); #endif - void set_strings(int index, const char *value); - void set_strings(int index, const char *value, size_t size); - ::std::string *add_strings(); - void add_strings(const ::std::string &value); + void set_strings(int index, const char *value); + void set_strings(int index, const char *value, size_t size); + ::std::string *add_strings(); + void add_strings(const ::std::string &value); #if LANG_CXX11 - void add_strings(::std::string &&value); + void add_strings(::std::string &&value); #endif - void add_strings(const char *value); - void add_strings(const char *value, size_t size); - const ::google::protobuf::RepeatedPtrField<::std::string> &strings() const; - ::google::protobuf::RepeatedPtrField<::std::string> *mutable_strings(); - - // repeated bool bools = 11; - int bools_size() const; - void clear_bools(); - static const int kBoolsFieldNumber = 11; - bool bools(int index) const; - void set_bools(int index, bool value); - void add_bools(bool value); - const ::google::protobuf::RepeatedField &bools() const; - ::google::protobuf::RepeatedField *mutable_bools(); - - // required 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 add_strings(const char *value); + void add_strings(const char *value, size_t size); + const ::google::protobuf::RepeatedPtrField<::std::string> &strings() const; + ::google::protobuf::RepeatedPtrField<::std::string> *mutable_strings(); + + // repeated bool bools = 11; + int bools_size() const; + void clear_bools(); + static const int kBoolsFieldNumber = 11; + bool bools(int index) const; + void set_bools(int index, bool value); + void add_bools(bool value); + const ::google::protobuf::RepeatedField &bools() const; + ::google::protobuf::RepeatedField *mutable_bools(); + + // required 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); #if LANG_CXX11 - void set_name(::std::string &&value); + void set_name(::std::string &&value); #endif - 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 s = 5; - bool has_s() const; - void clear_s(); - static const int kSFieldNumber = 5; - const ::std::string &s() const; - void set_s(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 s = 5; + bool has_s() const; + void clear_s(); + static const int kSFieldNumber = 5; + const ::std::string &s() const; + void set_s(const ::std::string &value); #if LANG_CXX11 - void set_s(::std::string &&value); + void set_s(::std::string &&value); #endif - void set_s(const char *value); - void set_s(const char *value, size_t size); - ::std::string *mutable_s(); - ::std::string *release_s(); - void set_allocated_s(::std::string *s); - - // required .paddle_mobile.framework.proto.AttrType type = 2; - bool has_type() const; - void clear_type(); - static const int kTypeFieldNumber = 2; - ::paddle_mobile::framework::proto::AttrType type() const; - void set_type(::paddle_mobile::framework::proto::AttrType value); - - // optional int32 i = 3; - bool has_i() const; - void clear_i(); - static const int kIFieldNumber = 3; - ::google::protobuf::int32 i() const; - void set_i(::google::protobuf::int32 value); - - // optional float f = 4; - bool has_f() const; - void clear_f(); - static const int kFFieldNumber = 4; - float f() const; - void set_f(float value); - - // optional bool b = 10; - bool has_b() const; - void clear_b(); - static const int kBFieldNumber = 10; - bool b() const; - void set_b(bool value); - - // optional int64 l = 13; - bool has_l() const; - void clear_l(); - static const int kLFieldNumber = 13; - ::google::protobuf::int64 l() const; - void set_l(::google::protobuf::int64 value); - - // optional int32 block_idx = 12; - bool has_block_idx() const; - void clear_block_idx(); - static const int kBlockIdxFieldNumber = 12; - ::google::protobuf::int32 block_idx() const; - void set_block_idx(::google::protobuf::int32 value); - - // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpDesc.Attr) - private: - void set_has_name(); - void clear_has_name(); - void set_has_type(); - void clear_has_type(); - void set_has_i(); - void clear_has_i(); - void set_has_f(); - void clear_has_f(); - void set_has_s(); - void clear_has_s(); - void set_has_b(); - void clear_has_b(); - void set_has_block_idx(); - void clear_has_block_idx(); - void set_has_l(); - void clear_has_l(); - - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - - ::google::protobuf::internal::InternalMetadataWithArenaLite - _internal_metadata_; - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable int _cached_size_; - ::google::protobuf::RepeatedField<::google::protobuf::int32> ints_; - ::google::protobuf::RepeatedField floats_; - ::google::protobuf::RepeatedPtrField<::std::string> strings_; - ::google::protobuf::RepeatedField bools_; - ::google::protobuf::internal::ArenaStringPtr name_; - ::google::protobuf::internal::ArenaStringPtr s_; - int type_; - ::google::protobuf::int32 i_; - float f_; - bool b_; - ::google::protobuf::int64 l_; - ::google::protobuf::int32 block_idx_; - friend struct protobuf_framework_2eproto::TableStruct; + void set_s(const char *value); + void set_s(const char *value, size_t size); + ::std::string *mutable_s(); + ::std::string *release_s(); + void set_allocated_s(::std::string *s); + + // required .paddle_mobile.framework.proto.AttrType type = 2; + bool has_type() const; + void clear_type(); + static const int kTypeFieldNumber = 2; + ::paddle_mobile::framework::proto::AttrType type() const; + void set_type(::paddle_mobile::framework::proto::AttrType value); + + // optional int32 i = 3; + bool has_i() const; + void clear_i(); + static const int kIFieldNumber = 3; + ::google::protobuf::int32 i() const; + void set_i(::google::protobuf::int32 value); + + // optional float f = 4; + bool has_f() const; + void clear_f(); + static const int kFFieldNumber = 4; + float f() const; + void set_f(float value); + + // optional bool b = 10; + bool has_b() const; + void clear_b(); + static const int kBFieldNumber = 10; + bool b() const; + void set_b(bool value); + + // optional int64 l = 13; + bool has_l() const; + void clear_l(); + static const int kLFieldNumber = 13; + ::google::protobuf::int64 l() const; + void set_l(::google::protobuf::int64 value); + + // optional int32 block_idx = 12; + bool has_block_idx() const; + void clear_block_idx(); + static const int kBlockIdxFieldNumber = 12; + ::google::protobuf::int32 block_idx() const; + void set_block_idx(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpDesc.Attr) +private: + void set_has_name(); + void clear_has_name(); + void set_has_type(); + void clear_has_type(); + void set_has_i(); + void clear_has_i(); + void set_has_f(); + void clear_has_f(); + void set_has_s(); + void clear_has_s(); + void set_has_b(); + void clear_has_b(); + void set_has_block_idx(); + void clear_has_block_idx(); + void set_has_l(); + void clear_has_l(); + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + ::google::protobuf::internal::InternalMetadataWithArenaLite + _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedField<::google::protobuf::int32> ints_; + ::google::protobuf::RepeatedField floats_; + ::google::protobuf::RepeatedPtrField<::std::string> strings_; + ::google::protobuf::RepeatedField bools_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr s_; + int type_; + ::google::protobuf::int32 i_; + float f_; + bool b_; + ::google::protobuf::int64 l_; + ::google::protobuf::int32 block_idx_; + friend struct protobuf_framework_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -416,139 +415,137 @@ class OpDesc_Var MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.OpDesc.Var) */ { - public: - OpDesc_Var(); - virtual ~OpDesc_Var(); +public: + OpDesc_Var(); + virtual ~OpDesc_Var(); - OpDesc_Var(const OpDesc_Var &from); + OpDesc_Var(const OpDesc_Var &from); - inline OpDesc_Var &operator=(const OpDesc_Var &from) { - CopyFrom(from); - return *this; - } + inline OpDesc_Var &operator=(const OpDesc_Var &from) { + CopyFrom(from); + return *this; + } #if LANG_CXX11 - OpDesc_Var(OpDesc_Var &&from) noexcept : OpDesc_Var() { - *this = ::std::move(from); - } - - inline OpDesc_Var &operator=(OpDesc_Var &&from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; + OpDesc_Var(OpDesc_Var &&from) noexcept : OpDesc_Var() { + *this = ::std::move(from); + } + + inline OpDesc_Var &operator=(OpDesc_Var &&from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) + InternalSwap(&from); + } else { + CopyFrom(from); } + return *this; + } #endif - inline const ::std::string &unknown_fields() const { - return _internal_metadata_.unknown_fields(); - } - inline ::std::string *mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); - } - - static const OpDesc_Var &default_instance(); - - static inline const OpDesc_Var *internal_default_instance() { - return reinterpret_cast( - &_OpDesc_Var_default_instance_); - } - static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 1; - - void Swap(OpDesc_Var *other); - friend void swap(OpDesc_Var &a, OpDesc_Var &b) { a.Swap(&b); } - - // implements Message - // ---------------------------------------------- - - inline OpDesc_Var *New() const PROTOBUF_FINAL { return New(NULL); } - - OpDesc_Var *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; - void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) - PROTOBUF_FINAL; - void CopyFrom(const OpDesc_Var &from); - void MergeFrom(const OpDesc_Var &from); - void Clear() PROTOBUF_FINAL; - bool IsInitialized() const PROTOBUF_FINAL; - - size_t ByteSizeLong() const PROTOBUF_FINAL; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; - void DiscardUnknownFields(); - int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(OpDesc_Var *other); - - private: - inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } - inline void *MaybeArenaPtr() const { return NULL; } - - public: - ::std::string GetTypeName() const PROTOBUF_FINAL; - - // nested types - // ---------------------------------------------------- - - // accessors - // ------------------------------------------------------- - - // repeated string arguments = 2; - int arguments_size() const; - void clear_arguments(); - static const int kArgumentsFieldNumber = 2; - const ::std::string &arguments(int index) const; - ::std::string *mutable_arguments(int index); - void set_arguments(int index, const ::std::string &value); + inline const ::std::string &unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::std::string *mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const OpDesc_Var &default_instance(); + + static inline const OpDesc_Var *internal_default_instance() { + return reinterpret_cast(&_OpDesc_Var_default_instance_); + } + static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 1; + + void Swap(OpDesc_Var *other); + friend void swap(OpDesc_Var &a, OpDesc_Var &b) { a.Swap(&b); } + + // implements Message + // ---------------------------------------------- + + inline OpDesc_Var *New() const PROTOBUF_FINAL { return New(NULL); } + + OpDesc_Var *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) + PROTOBUF_FINAL; + void CopyFrom(const OpDesc_Var &from); + void MergeFrom(const OpDesc_Var &from); + void Clear() PROTOBUF_FINAL; + bool IsInitialized() const PROTOBUF_FINAL; + + size_t ByteSizeLong() const PROTOBUF_FINAL; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; + void DiscardUnknownFields(); + int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } + +private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(OpDesc_Var *other); + +private: + inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } + inline void *MaybeArenaPtr() const { return NULL; } + +public: + ::std::string GetTypeName() const PROTOBUF_FINAL; + + // nested types + // ---------------------------------------------------- + + // accessors + // ------------------------------------------------------- + + // repeated string arguments = 2; + int arguments_size() const; + void clear_arguments(); + static const int kArgumentsFieldNumber = 2; + const ::std::string &arguments(int index) const; + ::std::string *mutable_arguments(int index); + void set_arguments(int index, const ::std::string &value); #if LANG_CXX11 - void set_arguments(int index, ::std::string &&value); + void set_arguments(int index, ::std::string &&value); #endif - void set_arguments(int index, const char *value); - void set_arguments(int index, const char *value, size_t size); - ::std::string *add_arguments(); - void add_arguments(const ::std::string &value); + void set_arguments(int index, const char *value); + void set_arguments(int index, const char *value, size_t size); + ::std::string *add_arguments(); + void add_arguments(const ::std::string &value); #if LANG_CXX11 - void add_arguments(::std::string &&value); + void add_arguments(::std::string &&value); #endif - void add_arguments(const char *value); - void add_arguments(const char *value, size_t size); - const ::google::protobuf::RepeatedPtrField<::std::string> & - arguments() const; - ::google::protobuf::RepeatedPtrField<::std::string> *mutable_arguments(); - - // required string parameter = 1; - bool has_parameter() const; - void clear_parameter(); - static const int kParameterFieldNumber = 1; - const ::std::string ¶meter() const; - void set_parameter(const ::std::string &value); + void add_arguments(const char *value); + void add_arguments(const char *value, size_t size); + const ::google::protobuf::RepeatedPtrField<::std::string> &arguments() const; + ::google::protobuf::RepeatedPtrField<::std::string> *mutable_arguments(); + + // required string parameter = 1; + bool has_parameter() const; + void clear_parameter(); + static const int kParameterFieldNumber = 1; + const ::std::string ¶meter() const; + void set_parameter(const ::std::string &value); #if LANG_CXX11 - void set_parameter(::std::string &&value); + void set_parameter(::std::string &&value); #endif - void set_parameter(const char *value); - void set_parameter(const char *value, size_t size); - ::std::string *mutable_parameter(); - ::std::string *release_parameter(); - void set_allocated_parameter(::std::string *parameter); - - // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpDesc.Var) - private: - void set_has_parameter(); - void clear_has_parameter(); - - ::google::protobuf::internal::InternalMetadataWithArenaLite - _internal_metadata_; - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable int _cached_size_; - ::google::protobuf::RepeatedPtrField<::std::string> arguments_; - ::google::protobuf::internal::ArenaStringPtr parameter_; - friend struct protobuf_framework_2eproto::TableStruct; + void set_parameter(const char *value); + void set_parameter(const char *value, size_t size); + ::std::string *mutable_parameter(); + ::std::string *release_parameter(); + void set_allocated_parameter(::std::string *parameter); + + // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpDesc.Var) +private: + void set_has_parameter(); + void clear_has_parameter(); + + ::google::protobuf::internal::InternalMetadataWithArenaLite + _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField<::std::string> arguments_; + ::google::protobuf::internal::ArenaStringPtr parameter_; + friend struct protobuf_framework_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -557,182 +554,179 @@ class OpDesc MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.OpDesc) */ { - public: - OpDesc(); - virtual ~OpDesc(); +public: + OpDesc(); + virtual ~OpDesc(); - OpDesc(const OpDesc &from); + OpDesc(const OpDesc &from); - inline OpDesc &operator=(const OpDesc &from) { - CopyFrom(from); - return *this; - } + inline OpDesc &operator=(const OpDesc &from) { + CopyFrom(from); + return *this; + } #if LANG_CXX11 - OpDesc(OpDesc &&from) noexcept : OpDesc() { *this = ::std::move(from); } - - inline OpDesc &operator=(OpDesc &&from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } -#endif - inline const ::std::string &unknown_fields() const { - return _internal_metadata_.unknown_fields(); - } - inline ::std::string *mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); - } + OpDesc(OpDesc &&from) noexcept : OpDesc() { *this = ::std::move(from); } - static const OpDesc &default_instance(); - - static inline const OpDesc *internal_default_instance() { - return reinterpret_cast(&_OpDesc_default_instance_); + inline OpDesc &operator=(OpDesc &&from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) + InternalSwap(&from); + } else { + CopyFrom(from); } - static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 2; - - void Swap(OpDesc *other); - friend void swap(OpDesc &a, OpDesc &b) { a.Swap(&b); } - - // implements Message - // ---------------------------------------------- - - inline OpDesc *New() const PROTOBUF_FINAL { return New(NULL); } - - OpDesc *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; - void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) - PROTOBUF_FINAL; - void CopyFrom(const OpDesc &from); - void MergeFrom(const OpDesc &from); - void Clear() PROTOBUF_FINAL; - bool IsInitialized() const PROTOBUF_FINAL; - - size_t ByteSizeLong() const PROTOBUF_FINAL; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; - void DiscardUnknownFields(); - int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(OpDesc *other); - - private: - inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } - inline void *MaybeArenaPtr() const { return NULL; } - - public: - ::std::string GetTypeName() const PROTOBUF_FINAL; - - // nested types - // ---------------------------------------------------- - - typedef OpDesc_Attr Attr; - typedef OpDesc_Var Var; - - // accessors - // ------------------------------------------------------- - - // repeated .paddle_mobile.framework.proto.OpDesc.Var inputs = - // 1; - int inputs_size() const; - void clear_inputs(); - static const int kInputsFieldNumber = 1; - const ::paddle_mobile::framework::proto::OpDesc_Var & - inputs(int index) const; - ::paddle_mobile::framework::proto::OpDesc_Var *mutable_inputs(int index); - ::paddle_mobile::framework::proto::OpDesc_Var *add_inputs(); - ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Var> * - mutable_inputs(); - const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Var> & - inputs() const; - - // repeated .paddle_mobile.framework.proto.OpDesc.Var outputs = - // 2; - int outputs_size() const; - void clear_outputs(); - static const int kOutputsFieldNumber = 2; - const ::paddle_mobile::framework::proto::OpDesc_Var & - outputs(int index) const; - ::paddle_mobile::framework::proto::OpDesc_Var *mutable_outputs(int index); - ::paddle_mobile::framework::proto::OpDesc_Var *add_outputs(); - ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Var> * - mutable_outputs(); - const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Var> & - outputs() const; - - // repeated .paddle_mobile.framework.proto.OpDesc.Attr attrs = - // 4; - int attrs_size() const; - void clear_attrs(); - static const int kAttrsFieldNumber = 4; - const ::paddle_mobile::framework::proto::OpDesc_Attr & - attrs(int index) const; - ::paddle_mobile::framework::proto::OpDesc_Attr *mutable_attrs(int index); - ::paddle_mobile::framework::proto::OpDesc_Attr *add_attrs(); - ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Attr> * - mutable_attrs(); - const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Attr> & - attrs() const; - - // required string type = 3; - bool has_type() const; - void clear_type(); - static const int kTypeFieldNumber = 3; - const ::std::string &type() const; - void set_type(const ::std::string &value); + return *this; + } +#endif + inline const ::std::string &unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::std::string *mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const OpDesc &default_instance(); + + static inline const OpDesc *internal_default_instance() { + return reinterpret_cast(&_OpDesc_default_instance_); + } + static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 2; + + void Swap(OpDesc *other); + friend void swap(OpDesc &a, OpDesc &b) { a.Swap(&b); } + + // implements Message + // ---------------------------------------------- + + inline OpDesc *New() const PROTOBUF_FINAL { return New(NULL); } + + OpDesc *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) + PROTOBUF_FINAL; + void CopyFrom(const OpDesc &from); + void MergeFrom(const OpDesc &from); + void Clear() PROTOBUF_FINAL; + bool IsInitialized() const PROTOBUF_FINAL; + + size_t ByteSizeLong() const PROTOBUF_FINAL; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; + void DiscardUnknownFields(); + int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } + +private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(OpDesc *other); + +private: + inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } + inline void *MaybeArenaPtr() const { return NULL; } + +public: + ::std::string GetTypeName() const PROTOBUF_FINAL; + + // nested types + // ---------------------------------------------------- + + typedef OpDesc_Attr Attr; + typedef OpDesc_Var Var; + + // accessors + // ------------------------------------------------------- + + // repeated .paddle_mobile.framework.proto.OpDesc.Var inputs = + // 1; + int inputs_size() const; + void clear_inputs(); + static const int kInputsFieldNumber = 1; + const ::paddle_mobile::framework::proto::OpDesc_Var &inputs(int index) const; + ::paddle_mobile::framework::proto::OpDesc_Var *mutable_inputs(int index); + ::paddle_mobile::framework::proto::OpDesc_Var *add_inputs(); + ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpDesc_Var> * + mutable_inputs(); + const ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpDesc_Var> & + inputs() const; + + // repeated .paddle_mobile.framework.proto.OpDesc.Var outputs = + // 2; + int outputs_size() const; + void clear_outputs(); + static const int kOutputsFieldNumber = 2; + const ::paddle_mobile::framework::proto::OpDesc_Var &outputs(int index) const; + ::paddle_mobile::framework::proto::OpDesc_Var *mutable_outputs(int index); + ::paddle_mobile::framework::proto::OpDesc_Var *add_outputs(); + ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpDesc_Var> * + mutable_outputs(); + const ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpDesc_Var> & + outputs() const; + + // repeated .paddle_mobile.framework.proto.OpDesc.Attr attrs = + // 4; + int attrs_size() const; + void clear_attrs(); + static const int kAttrsFieldNumber = 4; + const ::paddle_mobile::framework::proto::OpDesc_Attr &attrs(int index) const; + ::paddle_mobile::framework::proto::OpDesc_Attr *mutable_attrs(int index); + ::paddle_mobile::framework::proto::OpDesc_Attr *add_attrs(); + ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpDesc_Attr> * + mutable_attrs(); + const ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpDesc_Attr> & + attrs() const; + + // required string type = 3; + bool has_type() const; + void clear_type(); + static const int kTypeFieldNumber = 3; + const ::std::string &type() const; + void set_type(const ::std::string &value); #if LANG_CXX11 - void set_type(::std::string &&value); + void set_type(::std::string &&value); #endif - 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 bool is_target = 5 [default = false]; - bool has_is_target() const; - void clear_is_target(); - static const int kIsTargetFieldNumber = 5; - bool is_target() const; - void set_is_target(bool value); - - // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpDesc) - private: - void set_has_type(); - void clear_has_type(); - void set_has_is_target(); - void clear_has_is_target(); - - ::google::protobuf::internal::InternalMetadataWithArenaLite - _internal_metadata_; - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable int _cached_size_; - ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Var> - inputs_; - ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Var> - outputs_; - ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc_Attr> - attrs_; - ::google::protobuf::internal::ArenaStringPtr type_; - bool is_target_; - friend struct protobuf_framework_2eproto::TableStruct; + 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 bool is_target = 5 [default = false]; + bool has_is_target() const; + void clear_is_target(); + static const int kIsTargetFieldNumber = 5; + bool is_target() const; + void set_is_target(bool value); + + // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpDesc) +private: + void set_has_type(); + void clear_has_type(); + void set_has_is_target(); + void clear_has_is_target(); + + ::google::protobuf::internal::InternalMetadataWithArenaLite + _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpDesc_Var> + inputs_; + ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpDesc_Var> + outputs_; + ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpDesc_Attr> + attrs_; + ::google::protobuf::internal::ArenaStringPtr type_; + bool is_target_; + friend struct protobuf_framework_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -741,166 +735,166 @@ class OpProto_Var MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.OpProto.Var) */ { - public: - OpProto_Var(); - virtual ~OpProto_Var(); +public: + OpProto_Var(); + virtual ~OpProto_Var(); - OpProto_Var(const OpProto_Var &from); + OpProto_Var(const OpProto_Var &from); - inline OpProto_Var &operator=(const OpProto_Var &from) { - CopyFrom(from); - return *this; - } + inline OpProto_Var &operator=(const OpProto_Var &from) { + CopyFrom(from); + return *this; + } #if LANG_CXX11 - OpProto_Var(OpProto_Var &&from) noexcept : OpProto_Var() { - *this = ::std::move(from); - } - - inline OpProto_Var &operator=(OpProto_Var &&from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; + OpProto_Var(OpProto_Var &&from) noexcept : OpProto_Var() { + *this = ::std::move(from); + } + + inline OpProto_Var &operator=(OpProto_Var &&from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) + InternalSwap(&from); + } else { + CopyFrom(from); } + return *this; + } #endif - inline const ::std::string &unknown_fields() const { - return _internal_metadata_.unknown_fields(); - } - inline ::std::string *mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); - } - - static const OpProto_Var &default_instance(); - - static inline const OpProto_Var *internal_default_instance() { - return reinterpret_cast( - &_OpProto_Var_default_instance_); - } - static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 3; - - void Swap(OpProto_Var *other); - friend void swap(OpProto_Var &a, OpProto_Var &b) { a.Swap(&b); } - - // implements Message - // ---------------------------------------------- - - inline OpProto_Var *New() const PROTOBUF_FINAL { return New(NULL); } - - OpProto_Var *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; - void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) - PROTOBUF_FINAL; - void CopyFrom(const OpProto_Var &from); - void MergeFrom(const OpProto_Var &from); - void Clear() PROTOBUF_FINAL; - bool IsInitialized() const PROTOBUF_FINAL; - - size_t ByteSizeLong() const PROTOBUF_FINAL; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; - void DiscardUnknownFields(); - int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(OpProto_Var *other); - - private: - inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } - inline void *MaybeArenaPtr() const { return NULL; } - - public: - ::std::string GetTypeName() const PROTOBUF_FINAL; - - // nested types - // ---------------------------------------------------- - - // accessors - // ------------------------------------------------------- - - // required 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); + inline const ::std::string &unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::std::string *mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const OpProto_Var &default_instance(); + + static inline const OpProto_Var *internal_default_instance() { + return reinterpret_cast( + &_OpProto_Var_default_instance_); + } + static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 3; + + void Swap(OpProto_Var *other); + friend void swap(OpProto_Var &a, OpProto_Var &b) { a.Swap(&b); } + + // implements Message + // ---------------------------------------------- + + inline OpProto_Var *New() const PROTOBUF_FINAL { return New(NULL); } + + OpProto_Var *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) + PROTOBUF_FINAL; + void CopyFrom(const OpProto_Var &from); + void MergeFrom(const OpProto_Var &from); + void Clear() PROTOBUF_FINAL; + bool IsInitialized() const PROTOBUF_FINAL; + + size_t ByteSizeLong() const PROTOBUF_FINAL; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; + void DiscardUnknownFields(); + int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } + +private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(OpProto_Var *other); + +private: + inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } + inline void *MaybeArenaPtr() const { return NULL; } + +public: + ::std::string GetTypeName() const PROTOBUF_FINAL; + + // nested types + // ---------------------------------------------------- + + // accessors + // ------------------------------------------------------- + + // required 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); #if LANG_CXX11 - void set_name(::std::string &&value); + void set_name(::std::string &&value); #endif - 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); - - // required string comment = 2; - bool has_comment() const; - void clear_comment(); - static const int kCommentFieldNumber = 2; - const ::std::string &comment() const; - void set_comment(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); + + // required string comment = 2; + bool has_comment() const; + void clear_comment(); + static const int kCommentFieldNumber = 2; + const ::std::string &comment() const; + void set_comment(const ::std::string &value); #if LANG_CXX11 - void set_comment(::std::string &&value); + void set_comment(::std::string &&value); #endif - void set_comment(const char *value); - void set_comment(const char *value, size_t size); - ::std::string *mutable_comment(); - ::std::string *release_comment(); - void set_allocated_comment(::std::string *comment); - - // optional bool duplicable = 3 [default = false]; - bool has_duplicable() const; - void clear_duplicable(); - static const int kDuplicableFieldNumber = 3; - bool duplicable() const; - void set_duplicable(bool value); - - // optional bool intermediate = 4 [default = false]; - bool has_intermediate() const; - void clear_intermediate(); - static const int kIntermediateFieldNumber = 4; - bool intermediate() const; - void set_intermediate(bool value); - - // optional bool dispensable = 5 [default = false]; - bool has_dispensable() const; - void clear_dispensable(); - static const int kDispensableFieldNumber = 5; - bool dispensable() const; - void set_dispensable(bool value); - - // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpProto.Var) - private: - void set_has_name(); - void clear_has_name(); - void set_has_comment(); - void clear_has_comment(); - void set_has_duplicable(); - void clear_has_duplicable(); - void set_has_intermediate(); - void clear_has_intermediate(); - void set_has_dispensable(); - void clear_has_dispensable(); - - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - - ::google::protobuf::internal::InternalMetadataWithArenaLite - _internal_metadata_; - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable int _cached_size_; - ::google::protobuf::internal::ArenaStringPtr name_; - ::google::protobuf::internal::ArenaStringPtr comment_; - bool duplicable_; - bool intermediate_; - bool dispensable_; - friend struct protobuf_framework_2eproto::TableStruct; + void set_comment(const char *value); + void set_comment(const char *value, size_t size); + ::std::string *mutable_comment(); + ::std::string *release_comment(); + void set_allocated_comment(::std::string *comment); + + // optional bool duplicable = 3 [default = false]; + bool has_duplicable() const; + void clear_duplicable(); + static const int kDuplicableFieldNumber = 3; + bool duplicable() const; + void set_duplicable(bool value); + + // optional bool intermediate = 4 [default = false]; + bool has_intermediate() const; + void clear_intermediate(); + static const int kIntermediateFieldNumber = 4; + bool intermediate() const; + void set_intermediate(bool value); + + // optional bool dispensable = 5 [default = false]; + bool has_dispensable() const; + void clear_dispensable(); + static const int kDispensableFieldNumber = 5; + bool dispensable() const; + void set_dispensable(bool value); + + // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpProto.Var) +private: + void set_has_name(); + void clear_has_name(); + void set_has_comment(); + void clear_has_comment(); + void set_has_duplicable(); + void clear_has_duplicable(); + void set_has_intermediate(); + void clear_has_intermediate(); + void set_has_dispensable(); + void clear_has_dispensable(); + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + ::google::protobuf::internal::InternalMetadataWithArenaLite + _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr comment_; + bool duplicable_; + bool intermediate_; + bool dispensable_; + friend struct protobuf_framework_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -909,156 +903,156 @@ class OpProto_Attr MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.OpProto.Attr) */ { - public: - OpProto_Attr(); - virtual ~OpProto_Attr(); +public: + OpProto_Attr(); + virtual ~OpProto_Attr(); - OpProto_Attr(const OpProto_Attr &from); + OpProto_Attr(const OpProto_Attr &from); - inline OpProto_Attr &operator=(const OpProto_Attr &from) { - CopyFrom(from); - return *this; - } + inline OpProto_Attr &operator=(const OpProto_Attr &from) { + CopyFrom(from); + return *this; + } #if LANG_CXX11 - OpProto_Attr(OpProto_Attr &&from) noexcept : OpProto_Attr() { - *this = ::std::move(from); - } - - inline OpProto_Attr &operator=(OpProto_Attr &&from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; + OpProto_Attr(OpProto_Attr &&from) noexcept : OpProto_Attr() { + *this = ::std::move(from); + } + + inline OpProto_Attr &operator=(OpProto_Attr &&from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) + InternalSwap(&from); + } else { + CopyFrom(from); } + return *this; + } #endif - inline const ::std::string &unknown_fields() const { - return _internal_metadata_.unknown_fields(); - } - inline ::std::string *mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); - } - - static const OpProto_Attr &default_instance(); - - static inline const OpProto_Attr *internal_default_instance() { - return reinterpret_cast( - &_OpProto_Attr_default_instance_); - } - static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 4; - - void Swap(OpProto_Attr *other); - friend void swap(OpProto_Attr &a, OpProto_Attr &b) { a.Swap(&b); } - - // implements Message - // ---------------------------------------------- - - inline OpProto_Attr *New() const PROTOBUF_FINAL { return New(NULL); } - - OpProto_Attr *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; - void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) - PROTOBUF_FINAL; - void CopyFrom(const OpProto_Attr &from); - void MergeFrom(const OpProto_Attr &from); - void Clear() PROTOBUF_FINAL; - bool IsInitialized() const PROTOBUF_FINAL; - - size_t ByteSizeLong() const PROTOBUF_FINAL; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; - void DiscardUnknownFields(); - int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(OpProto_Attr *other); - - private: - inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } - inline void *MaybeArenaPtr() const { return NULL; } - - public: - ::std::string GetTypeName() const PROTOBUF_FINAL; - - // nested types - // ---------------------------------------------------- - - // accessors - // ------------------------------------------------------- - - // required 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); + inline const ::std::string &unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::std::string *mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const OpProto_Attr &default_instance(); + + static inline const OpProto_Attr *internal_default_instance() { + return reinterpret_cast( + &_OpProto_Attr_default_instance_); + } + static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 4; + + void Swap(OpProto_Attr *other); + friend void swap(OpProto_Attr &a, OpProto_Attr &b) { a.Swap(&b); } + + // implements Message + // ---------------------------------------------- + + inline OpProto_Attr *New() const PROTOBUF_FINAL { return New(NULL); } + + OpProto_Attr *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) + PROTOBUF_FINAL; + void CopyFrom(const OpProto_Attr &from); + void MergeFrom(const OpProto_Attr &from); + void Clear() PROTOBUF_FINAL; + bool IsInitialized() const PROTOBUF_FINAL; + + size_t ByteSizeLong() const PROTOBUF_FINAL; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; + void DiscardUnknownFields(); + int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } + +private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(OpProto_Attr *other); + +private: + inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } + inline void *MaybeArenaPtr() const { return NULL; } + +public: + ::std::string GetTypeName() const PROTOBUF_FINAL; + + // nested types + // ---------------------------------------------------- + + // accessors + // ------------------------------------------------------- + + // required 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); #if LANG_CXX11 - void set_name(::std::string &&value); + void set_name(::std::string &&value); #endif - 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); - - // required string comment = 3; - bool has_comment() const; - void clear_comment(); - static const int kCommentFieldNumber = 3; - const ::std::string &comment() const; - void set_comment(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); + + // required string comment = 3; + bool has_comment() const; + void clear_comment(); + static const int kCommentFieldNumber = 3; + const ::std::string &comment() const; + void set_comment(const ::std::string &value); #if LANG_CXX11 - void set_comment(::std::string &&value); + void set_comment(::std::string &&value); #endif - void set_comment(const char *value); - void set_comment(const char *value, size_t size); - ::std::string *mutable_comment(); - ::std::string *release_comment(); - void set_allocated_comment(::std::string *comment); - - // required .paddle_mobile.framework.proto.AttrType type = 2; - bool has_type() const; - void clear_type(); - static const int kTypeFieldNumber = 2; - ::paddle_mobile::framework::proto::AttrType type() const; - void set_type(::paddle_mobile::framework::proto::AttrType value); - - // optional bool generated = 4 [default = false]; - bool has_generated() const; - void clear_generated(); - static const int kGeneratedFieldNumber = 4; - bool generated() const; - void set_generated(bool value); - - // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpProto.Attr) - private: - void set_has_name(); - void clear_has_name(); - void set_has_type(); - void clear_has_type(); - void set_has_comment(); - void clear_has_comment(); - void set_has_generated(); - void clear_has_generated(); - - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - - ::google::protobuf::internal::InternalMetadataWithArenaLite - _internal_metadata_; - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable int _cached_size_; - ::google::protobuf::internal::ArenaStringPtr name_; - ::google::protobuf::internal::ArenaStringPtr comment_; - int type_; - bool generated_; - friend struct protobuf_framework_2eproto::TableStruct; + void set_comment(const char *value); + void set_comment(const char *value, size_t size); + ::std::string *mutable_comment(); + ::std::string *release_comment(); + void set_allocated_comment(::std::string *comment); + + // required .paddle_mobile.framework.proto.AttrType type = 2; + bool has_type() const; + void clear_type(); + static const int kTypeFieldNumber = 2; + ::paddle_mobile::framework::proto::AttrType type() const; + void set_type(::paddle_mobile::framework::proto::AttrType value); + + // optional bool generated = 4 [default = false]; + bool has_generated() const; + void clear_generated(); + static const int kGeneratedFieldNumber = 4; + bool generated() const; + void set_generated(bool value); + + // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpProto.Attr) +private: + void set_has_name(); + void clear_has_name(); + void set_has_type(); + void clear_has_type(); + void set_has_comment(); + void clear_has_comment(); + void set_has_generated(); + void clear_has_generated(); + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + ::google::protobuf::internal::InternalMetadataWithArenaLite + _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr comment_; + int type_; + bool generated_; + friend struct protobuf_framework_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -1067,193 +1061,191 @@ class OpProto MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.OpProto) */ { - public: - OpProto(); - virtual ~OpProto(); +public: + OpProto(); + virtual ~OpProto(); - OpProto(const OpProto &from); + OpProto(const OpProto &from); - inline OpProto &operator=(const OpProto &from) { - CopyFrom(from); - return *this; - } + inline OpProto &operator=(const OpProto &from) { + CopyFrom(from); + return *this; + } #if LANG_CXX11 - OpProto(OpProto &&from) noexcept : OpProto() { *this = ::std::move(from); } - - inline OpProto &operator=(OpProto &&from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } -#endif - inline const ::std::string &unknown_fields() const { - return _internal_metadata_.unknown_fields(); - } - inline ::std::string *mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); - } + OpProto(OpProto &&from) noexcept : OpProto() { *this = ::std::move(from); } - static const OpProto &default_instance(); - - static inline const OpProto *internal_default_instance() { - return reinterpret_cast(&_OpProto_default_instance_); + inline OpProto &operator=(OpProto &&from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) + InternalSwap(&from); + } else { + CopyFrom(from); } - static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 5; - - void Swap(OpProto *other); - friend void swap(OpProto &a, OpProto &b) { a.Swap(&b); } - - // implements Message - // ---------------------------------------------- - - inline OpProto *New() const PROTOBUF_FINAL { return New(NULL); } - - OpProto *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; - void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) - PROTOBUF_FINAL; - void CopyFrom(const OpProto &from); - void MergeFrom(const OpProto &from); - void Clear() PROTOBUF_FINAL; - bool IsInitialized() const PROTOBUF_FINAL; - - size_t ByteSizeLong() const PROTOBUF_FINAL; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; - void DiscardUnknownFields(); - int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(OpProto *other); - - private: - inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } - inline void *MaybeArenaPtr() const { return NULL; } - - public: - ::std::string GetTypeName() const PROTOBUF_FINAL; - - // nested types - // ---------------------------------------------------- - - typedef OpProto_Var Var; - typedef OpProto_Attr Attr; - - // accessors - // ------------------------------------------------------- - - // repeated .paddle_mobile.framework.proto.OpProto.Var inputs = - // 2; - int inputs_size() const; - void clear_inputs(); - static const int kInputsFieldNumber = 2; - const ::paddle_mobile::framework::proto::OpProto_Var & - inputs(int index) const; - ::paddle_mobile::framework::proto::OpProto_Var *mutable_inputs(int index); - ::paddle_mobile::framework::proto::OpProto_Var *add_inputs(); - ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Var> * - mutable_inputs(); - const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Var> & - inputs() const; - - // repeated .paddle_mobile.framework.proto.OpProto.Var outputs = - // 3; - int outputs_size() const; - void clear_outputs(); - static const int kOutputsFieldNumber = 3; - const ::paddle_mobile::framework::proto::OpProto_Var & - outputs(int index) const; - ::paddle_mobile::framework::proto::OpProto_Var *mutable_outputs(int index); - ::paddle_mobile::framework::proto::OpProto_Var *add_outputs(); - ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Var> * - mutable_outputs(); - const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Var> & - outputs() const; - - // repeated .paddle_mobile.framework.proto.OpProto.Attr attrs = - // 4; - int attrs_size() const; - void clear_attrs(); - static const int kAttrsFieldNumber = 4; - const ::paddle_mobile::framework::proto::OpProto_Attr & - attrs(int index) const; - ::paddle_mobile::framework::proto::OpProto_Attr *mutable_attrs(int index); - ::paddle_mobile::framework::proto::OpProto_Attr *add_attrs(); - ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Attr> * - mutable_attrs(); - const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Attr> & - attrs() const; - - // required string type = 1; - bool has_type() const; - void clear_type(); - static const int kTypeFieldNumber = 1; - const ::std::string &type() const; - void set_type(const ::std::string &value); + return *this; + } +#endif + inline const ::std::string &unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::std::string *mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const OpProto &default_instance(); + + static inline const OpProto *internal_default_instance() { + return reinterpret_cast(&_OpProto_default_instance_); + } + static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 5; + + void Swap(OpProto *other); + friend void swap(OpProto &a, OpProto &b) { a.Swap(&b); } + + // implements Message + // ---------------------------------------------- + + inline OpProto *New() const PROTOBUF_FINAL { return New(NULL); } + + OpProto *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) + PROTOBUF_FINAL; + void CopyFrom(const OpProto &from); + void MergeFrom(const OpProto &from); + void Clear() PROTOBUF_FINAL; + bool IsInitialized() const PROTOBUF_FINAL; + + size_t ByteSizeLong() const PROTOBUF_FINAL; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; + void DiscardUnknownFields(); + int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } + +private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(OpProto *other); + +private: + inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } + inline void *MaybeArenaPtr() const { return NULL; } + +public: + ::std::string GetTypeName() const PROTOBUF_FINAL; + + // nested types + // ---------------------------------------------------- + + typedef OpProto_Var Var; + typedef OpProto_Attr Attr; + + // accessors + // ------------------------------------------------------- + + // repeated .paddle_mobile.framework.proto.OpProto.Var inputs = + // 2; + int inputs_size() const; + void clear_inputs(); + static const int kInputsFieldNumber = 2; + const ::paddle_mobile::framework::proto::OpProto_Var &inputs(int index) const; + ::paddle_mobile::framework::proto::OpProto_Var *mutable_inputs(int index); + ::paddle_mobile::framework::proto::OpProto_Var *add_inputs(); + ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpProto_Var> * + mutable_inputs(); + const ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpProto_Var> & + inputs() const; + + // repeated .paddle_mobile.framework.proto.OpProto.Var outputs = + // 3; + int outputs_size() const; + void clear_outputs(); + static const int kOutputsFieldNumber = 3; + const ::paddle_mobile::framework::proto::OpProto_Var & + outputs(int index) const; + ::paddle_mobile::framework::proto::OpProto_Var *mutable_outputs(int index); + ::paddle_mobile::framework::proto::OpProto_Var *add_outputs(); + ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpProto_Var> * + mutable_outputs(); + const ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpProto_Var> & + outputs() const; + + // repeated .paddle_mobile.framework.proto.OpProto.Attr attrs = + // 4; + int attrs_size() const; + void clear_attrs(); + static const int kAttrsFieldNumber = 4; + const ::paddle_mobile::framework::proto::OpProto_Attr &attrs(int index) const; + ::paddle_mobile::framework::proto::OpProto_Attr *mutable_attrs(int index); + ::paddle_mobile::framework::proto::OpProto_Attr *add_attrs(); + ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpProto_Attr> * + mutable_attrs(); + const ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpProto_Attr> & + attrs() const; + + // required string type = 1; + bool has_type() const; + void clear_type(); + static const int kTypeFieldNumber = 1; + const ::std::string &type() const; + void set_type(const ::std::string &value); #if LANG_CXX11 - void set_type(::std::string &&value); + void set_type(::std::string &&value); #endif - 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); - - // required string comment = 5; - bool has_comment() const; - void clear_comment(); - static const int kCommentFieldNumber = 5; - const ::std::string &comment() const; - void set_comment(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); + + // required string comment = 5; + bool has_comment() const; + void clear_comment(); + static const int kCommentFieldNumber = 5; + const ::std::string &comment() const; + void set_comment(const ::std::string &value); #if LANG_CXX11 - void set_comment(::std::string &&value); + void set_comment(::std::string &&value); #endif - void set_comment(const char *value); - void set_comment(const char *value, size_t size); - ::std::string *mutable_comment(); - ::std::string *release_comment(); - void set_allocated_comment(::std::string *comment); - - // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpProto) - private: - void set_has_type(); - void clear_has_type(); - void set_has_comment(); - void clear_has_comment(); - - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - - ::google::protobuf::internal::InternalMetadataWithArenaLite - _internal_metadata_; - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable int _cached_size_; - ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Var> - inputs_; - ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Var> - outputs_; - ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpProto_Attr> - attrs_; - ::google::protobuf::internal::ArenaStringPtr type_; - ::google::protobuf::internal::ArenaStringPtr comment_; - friend struct protobuf_framework_2eproto::TableStruct; + void set_comment(const char *value); + void set_comment(const char *value, size_t size); + ::std::string *mutable_comment(); + ::std::string *release_comment(); + void set_allocated_comment(::std::string *comment); + + // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.OpProto) +private: + void set_has_type(); + void clear_has_type(); + void set_has_comment(); + void clear_has_comment(); + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + ::google::protobuf::internal::InternalMetadataWithArenaLite + _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpProto_Var> + inputs_; + ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpProto_Var> + outputs_; + ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpProto_Attr> + attrs_; + ::google::protobuf::internal::ArenaStringPtr type_; + ::google::protobuf::internal::ArenaStringPtr comment_; + friend struct protobuf_framework_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -1262,125 +1254,122 @@ class VarType_TensorDesc MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType.TensorDesc) */ { - public: - VarType_TensorDesc(); - virtual ~VarType_TensorDesc(); +public: + VarType_TensorDesc(); + virtual ~VarType_TensorDesc(); - VarType_TensorDesc(const VarType_TensorDesc &from); + VarType_TensorDesc(const VarType_TensorDesc &from); - inline VarType_TensorDesc &operator=(const VarType_TensorDesc &from) { - CopyFrom(from); - return *this; - } + inline VarType_TensorDesc &operator=(const VarType_TensorDesc &from) { + CopyFrom(from); + return *this; + } #if LANG_CXX11 - VarType_TensorDesc(VarType_TensorDesc &&from) noexcept - : VarType_TensorDesc() { - *this = ::std::move(from); - } - - inline VarType_TensorDesc &operator=(VarType_TensorDesc &&from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; + VarType_TensorDesc(VarType_TensorDesc &&from) noexcept + : VarType_TensorDesc() { + *this = ::std::move(from); + } + + inline VarType_TensorDesc &operator=(VarType_TensorDesc &&from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) + InternalSwap(&from); + } else { + CopyFrom(from); } + return *this; + } #endif - inline const ::std::string &unknown_fields() const { - return _internal_metadata_.unknown_fields(); - } - inline ::std::string *mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); - } - - static const VarType_TensorDesc &default_instance(); - - static inline const VarType_TensorDesc *internal_default_instance() { - return reinterpret_cast( - &_VarType_TensorDesc_default_instance_); - } - static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 6; - - void Swap(VarType_TensorDesc *other); - friend void swap(VarType_TensorDesc &a, VarType_TensorDesc &b) { - a.Swap(&b); - } - - // implements Message - // ---------------------------------------------- - - inline VarType_TensorDesc *New() const PROTOBUF_FINAL { return New(NULL); } - - VarType_TensorDesc * - New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; - void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) - PROTOBUF_FINAL; - void CopyFrom(const VarType_TensorDesc &from); - void MergeFrom(const VarType_TensorDesc &from); - void Clear() PROTOBUF_FINAL; - bool IsInitialized() const PROTOBUF_FINAL; - - size_t ByteSizeLong() const PROTOBUF_FINAL; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; - void DiscardUnknownFields(); - int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(VarType_TensorDesc *other); - - private: - inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } - inline void *MaybeArenaPtr() const { return NULL; } - - public: - ::std::string GetTypeName() const PROTOBUF_FINAL; - - // nested types - // ---------------------------------------------------- - - // accessors - // ------------------------------------------------------- - - // repeated int64 dims = 2; - int dims_size() const; - void clear_dims(); - static const int kDimsFieldNumber = 2; - ::google::protobuf::int64 dims(int index) const; - void set_dims(int index, ::google::protobuf::int64 value); - void add_dims(::google::protobuf::int64 value); - const ::google::protobuf::RepeatedField<::google::protobuf::int64> & - dims() const; - ::google::protobuf::RepeatedField<::google::protobuf::int64> * - mutable_dims(); - - // required .paddle_mobile.framework.proto.VarType.Type - // data_type = 1; - bool has_data_type() const; - void clear_data_type(); - static const int kDataTypeFieldNumber = 1; - ::paddle_mobile::framework::proto::VarType_Type data_type() const; - void set_data_type(::paddle_mobile::framework::proto::VarType_Type value); - - // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.TensorDesc) - private: - void set_has_data_type(); - void clear_has_data_type(); - - ::google::protobuf::internal::InternalMetadataWithArenaLite - _internal_metadata_; - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable int _cached_size_; - ::google::protobuf::RepeatedField<::google::protobuf::int64> dims_; - int data_type_; - friend struct protobuf_framework_2eproto::TableStruct; + inline const ::std::string &unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::std::string *mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const VarType_TensorDesc &default_instance(); + + static inline const VarType_TensorDesc *internal_default_instance() { + return reinterpret_cast( + &_VarType_TensorDesc_default_instance_); + } + static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 6; + + void Swap(VarType_TensorDesc *other); + friend void swap(VarType_TensorDesc &a, VarType_TensorDesc &b) { a.Swap(&b); } + + // implements Message + // ---------------------------------------------- + + inline VarType_TensorDesc *New() const PROTOBUF_FINAL { return New(NULL); } + + VarType_TensorDesc * + New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) + PROTOBUF_FINAL; + void CopyFrom(const VarType_TensorDesc &from); + void MergeFrom(const VarType_TensorDesc &from); + void Clear() PROTOBUF_FINAL; + bool IsInitialized() const PROTOBUF_FINAL; + + size_t ByteSizeLong() const PROTOBUF_FINAL; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; + void DiscardUnknownFields(); + int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } + +private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(VarType_TensorDesc *other); + +private: + inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } + inline void *MaybeArenaPtr() const { return NULL; } + +public: + ::std::string GetTypeName() const PROTOBUF_FINAL; + + // nested types + // ---------------------------------------------------- + + // accessors + // ------------------------------------------------------- + + // repeated int64 dims = 2; + int dims_size() const; + void clear_dims(); + static const int kDimsFieldNumber = 2; + ::google::protobuf::int64 dims(int index) const; + void set_dims(int index, ::google::protobuf::int64 value); + void add_dims(::google::protobuf::int64 value); + const ::google::protobuf::RepeatedField<::google::protobuf::int64> & + dims() const; + ::google::protobuf::RepeatedField<::google::protobuf::int64> *mutable_dims(); + + // required .paddle_mobile.framework.proto.VarType.Type + // data_type = 1; + bool has_data_type() const; + void clear_data_type(); + static const int kDataTypeFieldNumber = 1; + ::paddle_mobile::framework::proto::VarType_Type data_type() const; + void set_data_type(::paddle_mobile::framework::proto::VarType_Type value); + + // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.TensorDesc) +private: + void set_has_data_type(); + void clear_has_data_type(); + + ::google::protobuf::internal::InternalMetadataWithArenaLite + _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedField<::google::protobuf::int64> dims_; + int data_type_; + friend struct protobuf_framework_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -1389,128 +1378,126 @@ class VarType_LoDTensorDesc MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType.LoDTensorDesc) */ { - public: - VarType_LoDTensorDesc(); - virtual ~VarType_LoDTensorDesc(); +public: + VarType_LoDTensorDesc(); + virtual ~VarType_LoDTensorDesc(); - VarType_LoDTensorDesc(const VarType_LoDTensorDesc &from); + VarType_LoDTensorDesc(const VarType_LoDTensorDesc &from); - inline VarType_LoDTensorDesc &operator=(const VarType_LoDTensorDesc &from) { - CopyFrom(from); - return *this; - } + inline VarType_LoDTensorDesc &operator=(const VarType_LoDTensorDesc &from) { + CopyFrom(from); + return *this; + } #if LANG_CXX11 - VarType_LoDTensorDesc(VarType_LoDTensorDesc &&from) noexcept - : VarType_LoDTensorDesc() { - *this = ::std::move(from); - } - - inline VarType_LoDTensorDesc & - operator=(VarType_LoDTensorDesc &&from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; + VarType_LoDTensorDesc(VarType_LoDTensorDesc &&from) noexcept + : VarType_LoDTensorDesc() { + *this = ::std::move(from); + } + + inline VarType_LoDTensorDesc & + operator=(VarType_LoDTensorDesc &&from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) + InternalSwap(&from); + } else { + CopyFrom(from); } + return *this; + } #endif - inline const ::std::string &unknown_fields() const { - return _internal_metadata_.unknown_fields(); - } - inline ::std::string *mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); - } - - static const VarType_LoDTensorDesc &default_instance(); - - static inline const VarType_LoDTensorDesc *internal_default_instance() { - return reinterpret_cast( - &_VarType_LoDTensorDesc_default_instance_); - } - static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 7; - - void Swap(VarType_LoDTensorDesc *other); - friend void swap(VarType_LoDTensorDesc &a, VarType_LoDTensorDesc &b) { - a.Swap(&b); - } - - // implements Message - // ---------------------------------------------- - - inline VarType_LoDTensorDesc *New() const PROTOBUF_FINAL { - return New(NULL); - } - - VarType_LoDTensorDesc * - New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; - void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) - PROTOBUF_FINAL; - void CopyFrom(const VarType_LoDTensorDesc &from); - void MergeFrom(const VarType_LoDTensorDesc &from); - void Clear() PROTOBUF_FINAL; - bool IsInitialized() const PROTOBUF_FINAL; - - size_t ByteSizeLong() const PROTOBUF_FINAL; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; - void DiscardUnknownFields(); - int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(VarType_LoDTensorDesc *other); - - private: - inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } - inline void *MaybeArenaPtr() const { return NULL; } - - public: - ::std::string GetTypeName() const PROTOBUF_FINAL; - - // nested types - // ---------------------------------------------------- - - // accessors - // ------------------------------------------------------- - - // required .paddle_mobile.framework.proto.VarType.TensorDesc - // tensor = 1; - bool has_tensor() const; - void clear_tensor(); - static const int kTensorFieldNumber = 1; - const ::paddle_mobile::framework::proto::VarType_TensorDesc &tensor() const; - ::paddle_mobile::framework::proto::VarType_TensorDesc *mutable_tensor(); - ::paddle_mobile::framework::proto::VarType_TensorDesc *release_tensor(); - void set_allocated_tensor( - ::paddle_mobile::framework::proto::VarType_TensorDesc *tensor); - - // optional int32 lod_level = 2 [default = 0]; - bool has_lod_level() const; - void clear_lod_level(); - static const int kLodLevelFieldNumber = 2; - ::google::protobuf::int32 lod_level() const; - void set_lod_level(::google::protobuf::int32 value); - - // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.LoDTensorDesc) - private: - void set_has_tensor(); - void clear_has_tensor(); - void set_has_lod_level(); - void clear_has_lod_level(); - - ::google::protobuf::internal::InternalMetadataWithArenaLite - _internal_metadata_; - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable int _cached_size_; - ::paddle_mobile::framework::proto::VarType_TensorDesc *tensor_; - ::google::protobuf::int32 lod_level_; - friend struct protobuf_framework_2eproto::TableStruct; + inline const ::std::string &unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::std::string *mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const VarType_LoDTensorDesc &default_instance(); + + static inline const VarType_LoDTensorDesc *internal_default_instance() { + return reinterpret_cast( + &_VarType_LoDTensorDesc_default_instance_); + } + static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 7; + + void Swap(VarType_LoDTensorDesc *other); + friend void swap(VarType_LoDTensorDesc &a, VarType_LoDTensorDesc &b) { + a.Swap(&b); + } + + // implements Message + // ---------------------------------------------- + + inline VarType_LoDTensorDesc *New() const PROTOBUF_FINAL { return New(NULL); } + + VarType_LoDTensorDesc * + New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) + PROTOBUF_FINAL; + void CopyFrom(const VarType_LoDTensorDesc &from); + void MergeFrom(const VarType_LoDTensorDesc &from); + void Clear() PROTOBUF_FINAL; + bool IsInitialized() const PROTOBUF_FINAL; + + size_t ByteSizeLong() const PROTOBUF_FINAL; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; + void DiscardUnknownFields(); + int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } + +private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(VarType_LoDTensorDesc *other); + +private: + inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } + inline void *MaybeArenaPtr() const { return NULL; } + +public: + ::std::string GetTypeName() const PROTOBUF_FINAL; + + // nested types + // ---------------------------------------------------- + + // accessors + // ------------------------------------------------------- + + // required .paddle_mobile.framework.proto.VarType.TensorDesc + // tensor = 1; + bool has_tensor() const; + void clear_tensor(); + static const int kTensorFieldNumber = 1; + const ::paddle_mobile::framework::proto::VarType_TensorDesc &tensor() const; + ::paddle_mobile::framework::proto::VarType_TensorDesc *mutable_tensor(); + ::paddle_mobile::framework::proto::VarType_TensorDesc *release_tensor(); + void set_allocated_tensor( + ::paddle_mobile::framework::proto::VarType_TensorDesc *tensor); + + // optional int32 lod_level = 2 [default = 0]; + bool has_lod_level() const; + void clear_lod_level(); + static const int kLodLevelFieldNumber = 2; + ::google::protobuf::int32 lod_level() const; + void set_lod_level(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.LoDTensorDesc) +private: + void set_has_tensor(); + void clear_has_tensor(); + void set_has_lod_level(); + void clear_has_lod_level(); + + ::google::protobuf::internal::InternalMetadataWithArenaLite + _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::paddle_mobile::framework::proto::VarType_TensorDesc *tensor_; + ::google::protobuf::int32 lod_level_; + friend struct protobuf_framework_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -1519,131 +1506,130 @@ class VarType_LoDTensorArrayDesc MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) */ { - public: - VarType_LoDTensorArrayDesc(); - virtual ~VarType_LoDTensorArrayDesc(); +public: + VarType_LoDTensorArrayDesc(); + virtual ~VarType_LoDTensorArrayDesc(); - VarType_LoDTensorArrayDesc(const VarType_LoDTensorArrayDesc &from); + VarType_LoDTensorArrayDesc(const VarType_LoDTensorArrayDesc &from); - inline VarType_LoDTensorArrayDesc & - operator=(const VarType_LoDTensorArrayDesc &from) { - CopyFrom(from); - return *this; - } + inline VarType_LoDTensorArrayDesc & + operator=(const VarType_LoDTensorArrayDesc &from) { + CopyFrom(from); + return *this; + } #if LANG_CXX11 - VarType_LoDTensorArrayDesc(VarType_LoDTensorArrayDesc &&from) noexcept - : VarType_LoDTensorArrayDesc() { - *this = ::std::move(from); - } - - inline VarType_LoDTensorArrayDesc & - operator=(VarType_LoDTensorArrayDesc &&from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; + VarType_LoDTensorArrayDesc(VarType_LoDTensorArrayDesc &&from) noexcept + : VarType_LoDTensorArrayDesc() { + *this = ::std::move(from); + } + + inline VarType_LoDTensorArrayDesc & + operator=(VarType_LoDTensorArrayDesc &&from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) + InternalSwap(&from); + } else { + CopyFrom(from); } + return *this; + } #endif - inline const ::std::string &unknown_fields() const { - return _internal_metadata_.unknown_fields(); - } - inline ::std::string *mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); - } - - static const VarType_LoDTensorArrayDesc &default_instance(); - - static inline const VarType_LoDTensorArrayDesc * - internal_default_instance() { - return reinterpret_cast( - &_VarType_LoDTensorArrayDesc_default_instance_); - } - static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 8; - - void Swap(VarType_LoDTensorArrayDesc *other); - friend void swap(VarType_LoDTensorArrayDesc &a, - VarType_LoDTensorArrayDesc &b) { - a.Swap(&b); - } - - // implements Message - // ---------------------------------------------- - - inline VarType_LoDTensorArrayDesc *New() const PROTOBUF_FINAL { - return New(NULL); - } - - VarType_LoDTensorArrayDesc * - New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; - void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) - PROTOBUF_FINAL; - void CopyFrom(const VarType_LoDTensorArrayDesc &from); - void MergeFrom(const VarType_LoDTensorArrayDesc &from); - void Clear() PROTOBUF_FINAL; - bool IsInitialized() const PROTOBUF_FINAL; - - size_t ByteSizeLong() const PROTOBUF_FINAL; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; - void DiscardUnknownFields(); - int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(VarType_LoDTensorArrayDesc *other); - - private: - inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } - inline void *MaybeArenaPtr() const { return NULL; } - - public: - ::std::string GetTypeName() const PROTOBUF_FINAL; - - // nested types - // ---------------------------------------------------- - - // accessors - // ------------------------------------------------------- - - // required .paddle_mobile.framework.proto.VarType.TensorDesc - // tensor = 1; - bool has_tensor() const; - void clear_tensor(); - static const int kTensorFieldNumber = 1; - const ::paddle_mobile::framework::proto::VarType_TensorDesc &tensor() const; - ::paddle_mobile::framework::proto::VarType_TensorDesc *mutable_tensor(); - ::paddle_mobile::framework::proto::VarType_TensorDesc *release_tensor(); - void set_allocated_tensor( - ::paddle_mobile::framework::proto::VarType_TensorDesc *tensor); - - // optional int32 lod_level = 2 [default = 0]; - bool has_lod_level() const; - void clear_lod_level(); - static const int kLodLevelFieldNumber = 2; - ::google::protobuf::int32 lod_level() const; - void set_lod_level(::google::protobuf::int32 value); - - // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) - private: - void set_has_tensor(); - void clear_has_tensor(); - void set_has_lod_level(); - void clear_has_lod_level(); - - ::google::protobuf::internal::InternalMetadataWithArenaLite - _internal_metadata_; - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable int _cached_size_; - ::paddle_mobile::framework::proto::VarType_TensorDesc *tensor_; - ::google::protobuf::int32 lod_level_; - friend struct protobuf_framework_2eproto::TableStruct; + inline const ::std::string &unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::std::string *mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const VarType_LoDTensorArrayDesc &default_instance(); + + static inline const VarType_LoDTensorArrayDesc *internal_default_instance() { + return reinterpret_cast( + &_VarType_LoDTensorArrayDesc_default_instance_); + } + static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 8; + + void Swap(VarType_LoDTensorArrayDesc *other); + friend void swap(VarType_LoDTensorArrayDesc &a, + VarType_LoDTensorArrayDesc &b) { + a.Swap(&b); + } + + // implements Message + // ---------------------------------------------- + + inline VarType_LoDTensorArrayDesc *New() const PROTOBUF_FINAL { + return New(NULL); + } + + VarType_LoDTensorArrayDesc * + New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) + PROTOBUF_FINAL; + void CopyFrom(const VarType_LoDTensorArrayDesc &from); + void MergeFrom(const VarType_LoDTensorArrayDesc &from); + void Clear() PROTOBUF_FINAL; + bool IsInitialized() const PROTOBUF_FINAL; + + size_t ByteSizeLong() const PROTOBUF_FINAL; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; + void DiscardUnknownFields(); + int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } + +private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(VarType_LoDTensorArrayDesc *other); + +private: + inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } + inline void *MaybeArenaPtr() const { return NULL; } + +public: + ::std::string GetTypeName() const PROTOBUF_FINAL; + + // nested types + // ---------------------------------------------------- + + // accessors + // ------------------------------------------------------- + + // required .paddle_mobile.framework.proto.VarType.TensorDesc + // tensor = 1; + bool has_tensor() const; + void clear_tensor(); + static const int kTensorFieldNumber = 1; + const ::paddle_mobile::framework::proto::VarType_TensorDesc &tensor() const; + ::paddle_mobile::framework::proto::VarType_TensorDesc *mutable_tensor(); + ::paddle_mobile::framework::proto::VarType_TensorDesc *release_tensor(); + void set_allocated_tensor( + ::paddle_mobile::framework::proto::VarType_TensorDesc *tensor); + + // optional int32 lod_level = 2 [default = 0]; + bool has_lod_level() const; + void clear_lod_level(); + static const int kLodLevelFieldNumber = 2; + ::google::protobuf::int32 lod_level() const; + void set_lod_level(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc) +private: + void set_has_tensor(); + void clear_has_tensor(); + void set_has_lod_level(); + void clear_has_lod_level(); + + ::google::protobuf::internal::InternalMetadataWithArenaLite + _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::paddle_mobile::framework::proto::VarType_TensorDesc *tensor_; + ::google::protobuf::int32 lod_level_; + friend struct protobuf_framework_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -1652,121 +1638,119 @@ class VarType_ReaderDesc MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType.ReaderDesc) */ { - public: - VarType_ReaderDesc(); - virtual ~VarType_ReaderDesc(); +public: + VarType_ReaderDesc(); + virtual ~VarType_ReaderDesc(); - VarType_ReaderDesc(const VarType_ReaderDesc &from); + VarType_ReaderDesc(const VarType_ReaderDesc &from); - inline VarType_ReaderDesc &operator=(const VarType_ReaderDesc &from) { - CopyFrom(from); - return *this; - } + inline VarType_ReaderDesc &operator=(const VarType_ReaderDesc &from) { + CopyFrom(from); + return *this; + } #if LANG_CXX11 - VarType_ReaderDesc(VarType_ReaderDesc &&from) noexcept - : VarType_ReaderDesc() { - *this = ::std::move(from); - } - - inline VarType_ReaderDesc &operator=(VarType_ReaderDesc &&from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; + VarType_ReaderDesc(VarType_ReaderDesc &&from) noexcept + : VarType_ReaderDesc() { + *this = ::std::move(from); + } + + inline VarType_ReaderDesc &operator=(VarType_ReaderDesc &&from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) + InternalSwap(&from); + } else { + CopyFrom(from); } + return *this; + } #endif - inline const ::std::string &unknown_fields() const { - return _internal_metadata_.unknown_fields(); - } - inline ::std::string *mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); - } - - static const VarType_ReaderDesc &default_instance(); - - static inline const VarType_ReaderDesc *internal_default_instance() { - return reinterpret_cast( - &_VarType_ReaderDesc_default_instance_); - } - static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 9; - - void Swap(VarType_ReaderDesc *other); - friend void swap(VarType_ReaderDesc &a, VarType_ReaderDesc &b) { - a.Swap(&b); - } - - // implements Message - // ---------------------------------------------- - - inline VarType_ReaderDesc *New() const PROTOBUF_FINAL { return New(NULL); } - - VarType_ReaderDesc * - New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; - void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) - PROTOBUF_FINAL; - void CopyFrom(const VarType_ReaderDesc &from); - void MergeFrom(const VarType_ReaderDesc &from); - void Clear() PROTOBUF_FINAL; - bool IsInitialized() const PROTOBUF_FINAL; - - size_t ByteSizeLong() const PROTOBUF_FINAL; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; - void DiscardUnknownFields(); - int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(VarType_ReaderDesc *other); - - private: - inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } - inline void *MaybeArenaPtr() const { return NULL; } - - public: - ::std::string GetTypeName() const PROTOBUF_FINAL; - - // nested types - // ---------------------------------------------------- - - // accessors - // ------------------------------------------------------- - - // repeated .paddle_mobile.framework.proto.VarType.LoDTensorDesc - // lod_tensor = - // 1; - int lod_tensor_size() const; - void clear_lod_tensor(); - static const int kLodTensorFieldNumber = 1; - const ::paddle_mobile::framework::proto::VarType_LoDTensorDesc & - lod_tensor(int index) const; - ::paddle_mobile::framework::proto::VarType_LoDTensorDesc * - mutable_lod_tensor(int index); - ::paddle_mobile::framework::proto::VarType_LoDTensorDesc *add_lod_tensor(); - ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> * - mutable_lod_tensor(); - const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> & - lod_tensor() const; - - // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.ReaderDesc) - private: - ::google::protobuf::internal::InternalMetadataWithArenaLite - _internal_metadata_; - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable int _cached_size_; - ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> - lod_tensor_; - friend struct protobuf_framework_2eproto::TableStruct; + inline const ::std::string &unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::std::string *mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const VarType_ReaderDesc &default_instance(); + + static inline const VarType_ReaderDesc *internal_default_instance() { + return reinterpret_cast( + &_VarType_ReaderDesc_default_instance_); + } + static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 9; + + void Swap(VarType_ReaderDesc *other); + friend void swap(VarType_ReaderDesc &a, VarType_ReaderDesc &b) { a.Swap(&b); } + + // implements Message + // ---------------------------------------------- + + inline VarType_ReaderDesc *New() const PROTOBUF_FINAL { return New(NULL); } + + VarType_ReaderDesc * + New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) + PROTOBUF_FINAL; + void CopyFrom(const VarType_ReaderDesc &from); + void MergeFrom(const VarType_ReaderDesc &from); + void Clear() PROTOBUF_FINAL; + bool IsInitialized() const PROTOBUF_FINAL; + + size_t ByteSizeLong() const PROTOBUF_FINAL; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; + void DiscardUnknownFields(); + int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } + +private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(VarType_ReaderDesc *other); + +private: + inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } + inline void *MaybeArenaPtr() const { return NULL; } + +public: + ::std::string GetTypeName() const PROTOBUF_FINAL; + + // nested types + // ---------------------------------------------------- + + // accessors + // ------------------------------------------------------- + + // repeated .paddle_mobile.framework.proto.VarType.LoDTensorDesc + // lod_tensor = + // 1; + int lod_tensor_size() const; + void clear_lod_tensor(); + static const int kLodTensorFieldNumber = 1; + const ::paddle_mobile::framework::proto::VarType_LoDTensorDesc & + lod_tensor(int index) const; + ::paddle_mobile::framework::proto::VarType_LoDTensorDesc * + mutable_lod_tensor(int index); + ::paddle_mobile::framework::proto::VarType_LoDTensorDesc *add_lod_tensor(); + ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> * + mutable_lod_tensor(); + const ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> & + lod_tensor() const; + + // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.ReaderDesc) +private: + ::google::protobuf::internal::InternalMetadataWithArenaLite + _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> + lod_tensor_; + friend struct protobuf_framework_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -1775,125 +1759,125 @@ class VarType_ChannelDesc MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType.ChannelDesc) */ { - public: - VarType_ChannelDesc(); - virtual ~VarType_ChannelDesc(); +public: + VarType_ChannelDesc(); + virtual ~VarType_ChannelDesc(); - VarType_ChannelDesc(const VarType_ChannelDesc &from); + VarType_ChannelDesc(const VarType_ChannelDesc &from); - inline VarType_ChannelDesc &operator=(const VarType_ChannelDesc &from) { - CopyFrom(from); - return *this; - } + inline VarType_ChannelDesc &operator=(const VarType_ChannelDesc &from) { + CopyFrom(from); + return *this; + } #if LANG_CXX11 - VarType_ChannelDesc(VarType_ChannelDesc &&from) noexcept - : VarType_ChannelDesc() { - *this = ::std::move(from); - } - - inline VarType_ChannelDesc &operator=(VarType_ChannelDesc &&from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; + VarType_ChannelDesc(VarType_ChannelDesc &&from) noexcept + : VarType_ChannelDesc() { + *this = ::std::move(from); + } + + inline VarType_ChannelDesc &operator=(VarType_ChannelDesc &&from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) + InternalSwap(&from); + } else { + CopyFrom(from); } + return *this; + } #endif - inline const ::std::string &unknown_fields() const { - return _internal_metadata_.unknown_fields(); - } - inline ::std::string *mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); - } - - static const VarType_ChannelDesc &default_instance(); - - static inline const VarType_ChannelDesc *internal_default_instance() { - return reinterpret_cast( - &_VarType_ChannelDesc_default_instance_); - } - static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 10; - - void Swap(VarType_ChannelDesc *other); - friend void swap(VarType_ChannelDesc &a, VarType_ChannelDesc &b) { - a.Swap(&b); - } - - // implements Message - // ---------------------------------------------- - - inline VarType_ChannelDesc *New() const PROTOBUF_FINAL { return New(NULL); } - - VarType_ChannelDesc * - New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; - void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) - PROTOBUF_FINAL; - void CopyFrom(const VarType_ChannelDesc &from); - void MergeFrom(const VarType_ChannelDesc &from); - void Clear() PROTOBUF_FINAL; - bool IsInitialized() const PROTOBUF_FINAL; - - size_t ByteSizeLong() const PROTOBUF_FINAL; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; - void DiscardUnknownFields(); - int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(VarType_ChannelDesc *other); - - private: - inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } - inline void *MaybeArenaPtr() const { return NULL; } - - public: - ::std::string GetTypeName() const PROTOBUF_FINAL; - - // nested types - // ---------------------------------------------------- - - // accessors - // ------------------------------------------------------- - - // required int64 capacity = 2; - bool has_capacity() const; - void clear_capacity(); - static const int kCapacityFieldNumber = 2; - ::google::protobuf::int64 capacity() const; - void set_capacity(::google::protobuf::int64 value); - - // required .paddle_mobile.framework.proto.VarType.Type - // data_type = 1; - bool has_data_type() const; - void clear_data_type(); - static const int kDataTypeFieldNumber = 1; - ::paddle_mobile::framework::proto::VarType_Type data_type() const; - void set_data_type(::paddle_mobile::framework::proto::VarType_Type value); - - // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.ChannelDesc) - private: - void set_has_data_type(); - void clear_has_data_type(); - void set_has_capacity(); - void clear_has_capacity(); - - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - - ::google::protobuf::internal::InternalMetadataWithArenaLite - _internal_metadata_; - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable int _cached_size_; - ::google::protobuf::int64 capacity_; - int data_type_; - friend struct protobuf_framework_2eproto::TableStruct; + inline const ::std::string &unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::std::string *mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const VarType_ChannelDesc &default_instance(); + + static inline const VarType_ChannelDesc *internal_default_instance() { + return reinterpret_cast( + &_VarType_ChannelDesc_default_instance_); + } + static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 10; + + void Swap(VarType_ChannelDesc *other); + friend void swap(VarType_ChannelDesc &a, VarType_ChannelDesc &b) { + a.Swap(&b); + } + + // implements Message + // ---------------------------------------------- + + inline VarType_ChannelDesc *New() const PROTOBUF_FINAL { return New(NULL); } + + VarType_ChannelDesc * + New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) + PROTOBUF_FINAL; + void CopyFrom(const VarType_ChannelDesc &from); + void MergeFrom(const VarType_ChannelDesc &from); + void Clear() PROTOBUF_FINAL; + bool IsInitialized() const PROTOBUF_FINAL; + + size_t ByteSizeLong() const PROTOBUF_FINAL; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; + void DiscardUnknownFields(); + int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } + +private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(VarType_ChannelDesc *other); + +private: + inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } + inline void *MaybeArenaPtr() const { return NULL; } + +public: + ::std::string GetTypeName() const PROTOBUF_FINAL; + + // nested types + // ---------------------------------------------------- + + // accessors + // ------------------------------------------------------- + + // required int64 capacity = 2; + bool has_capacity() const; + void clear_capacity(); + static const int kCapacityFieldNumber = 2; + ::google::protobuf::int64 capacity() const; + void set_capacity(::google::protobuf::int64 value); + + // required .paddle_mobile.framework.proto.VarType.Type + // data_type = 1; + bool has_data_type() const; + void clear_data_type(); + static const int kDataTypeFieldNumber = 1; + ::paddle_mobile::framework::proto::VarType_Type data_type() const; + void set_data_type(::paddle_mobile::framework::proto::VarType_Type value); + + // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.ChannelDesc) +private: + void set_has_data_type(); + void clear_has_data_type(); + void set_has_capacity(); + void clear_has_capacity(); + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + ::google::protobuf::internal::InternalMetadataWithArenaLite + _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::int64 capacity_; + int data_type_; + friend struct protobuf_framework_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -1902,112 +1886,109 @@ class VarType_Tuple MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType.Tuple) */ { - public: - VarType_Tuple(); - virtual ~VarType_Tuple(); +public: + VarType_Tuple(); + virtual ~VarType_Tuple(); - VarType_Tuple(const VarType_Tuple &from); + VarType_Tuple(const VarType_Tuple &from); - inline VarType_Tuple &operator=(const VarType_Tuple &from) { - CopyFrom(from); - return *this; - } + inline VarType_Tuple &operator=(const VarType_Tuple &from) { + CopyFrom(from); + return *this; + } #if LANG_CXX11 - VarType_Tuple(VarType_Tuple &&from) noexcept : VarType_Tuple() { - *this = ::std::move(from); - } - - inline VarType_Tuple &operator=(VarType_Tuple &&from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; + VarType_Tuple(VarType_Tuple &&from) noexcept : VarType_Tuple() { + *this = ::std::move(from); + } + + inline VarType_Tuple &operator=(VarType_Tuple &&from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) + InternalSwap(&from); + } else { + CopyFrom(from); } + return *this; + } #endif - inline const ::std::string &unknown_fields() const { - return _internal_metadata_.unknown_fields(); - } - inline ::std::string *mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); - } - - static const VarType_Tuple &default_instance(); - - static inline const VarType_Tuple *internal_default_instance() { - return reinterpret_cast( - &_VarType_Tuple_default_instance_); - } - static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 11; - - void Swap(VarType_Tuple *other); - friend void swap(VarType_Tuple &a, VarType_Tuple &b) { a.Swap(&b); } - - // implements Message - // ---------------------------------------------- - - inline VarType_Tuple *New() const PROTOBUF_FINAL { return New(NULL); } - - VarType_Tuple *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; - void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) - PROTOBUF_FINAL; - void CopyFrom(const VarType_Tuple &from); - void MergeFrom(const VarType_Tuple &from); - void Clear() PROTOBUF_FINAL; - bool IsInitialized() const PROTOBUF_FINAL; - - size_t ByteSizeLong() const PROTOBUF_FINAL; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; - void DiscardUnknownFields(); - int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(VarType_Tuple *other); - - private: - inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } - inline void *MaybeArenaPtr() const { return NULL; } - - public: - ::std::string GetTypeName() const PROTOBUF_FINAL; - - // nested types - // ---------------------------------------------------- - - // accessors - // ------------------------------------------------------- - - // repeated .paddle_mobile.framework.proto.VarType.Type - // element_type = 1; - int element_type_size() const; - void clear_element_type(); - static const int kElementTypeFieldNumber = 1; - ::paddle_mobile::framework::proto::VarType_Type - element_type(int index) const; - void - set_element_type(int index, - ::paddle_mobile::framework::proto::VarType_Type value); - void - add_element_type(::paddle_mobile::framework::proto::VarType_Type value); - const ::google::protobuf::RepeatedField &element_type() const; - ::google::protobuf::RepeatedField *mutable_element_type(); - - // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.Tuple) - private: - ::google::protobuf::internal::InternalMetadataWithArenaLite - _internal_metadata_; - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable int _cached_size_; - ::google::protobuf::RepeatedField element_type_; - friend struct protobuf_framework_2eproto::TableStruct; + inline const ::std::string &unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::std::string *mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const VarType_Tuple &default_instance(); + + static inline const VarType_Tuple *internal_default_instance() { + return reinterpret_cast( + &_VarType_Tuple_default_instance_); + } + static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 11; + + void Swap(VarType_Tuple *other); + friend void swap(VarType_Tuple &a, VarType_Tuple &b) { a.Swap(&b); } + + // implements Message + // ---------------------------------------------- + + inline VarType_Tuple *New() const PROTOBUF_FINAL { return New(NULL); } + + VarType_Tuple *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) + PROTOBUF_FINAL; + void CopyFrom(const VarType_Tuple &from); + void MergeFrom(const VarType_Tuple &from); + void Clear() PROTOBUF_FINAL; + bool IsInitialized() const PROTOBUF_FINAL; + + size_t ByteSizeLong() const PROTOBUF_FINAL; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; + void DiscardUnknownFields(); + int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } + +private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(VarType_Tuple *other); + +private: + inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } + inline void *MaybeArenaPtr() const { return NULL; } + +public: + ::std::string GetTypeName() const PROTOBUF_FINAL; + + // nested types + // ---------------------------------------------------- + + // accessors + // ------------------------------------------------------- + + // repeated .paddle_mobile.framework.proto.VarType.Type + // element_type = 1; + int element_type_size() const; + void clear_element_type(); + static const int kElementTypeFieldNumber = 1; + ::paddle_mobile::framework::proto::VarType_Type element_type(int index) const; + void set_element_type(int index, + ::paddle_mobile::framework::proto::VarType_Type value); + void add_element_type(::paddle_mobile::framework::proto::VarType_Type value); + const ::google::protobuf::RepeatedField &element_type() const; + ::google::protobuf::RepeatedField *mutable_element_type(); + + // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType.Tuple) +private: + ::google::protobuf::internal::InternalMetadataWithArenaLite + _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedField element_type_; + friend struct protobuf_framework_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -2016,238 +1997,236 @@ class VarType MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarType) */ { - public: - VarType(); - virtual ~VarType(); +public: + VarType(); + virtual ~VarType(); - VarType(const VarType &from); + VarType(const VarType &from); - inline VarType &operator=(const VarType &from) { - CopyFrom(from); - return *this; - } + inline VarType &operator=(const VarType &from) { + CopyFrom(from); + return *this; + } #if LANG_CXX11 - VarType(VarType &&from) noexcept : VarType() { *this = ::std::move(from); } - - inline VarType &operator=(VarType &&from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } -#endif - inline const ::std::string &unknown_fields() const { - return _internal_metadata_.unknown_fields(); - } - inline ::std::string *mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); - } + VarType(VarType &&from) noexcept : VarType() { *this = ::std::move(from); } - static const VarType &default_instance(); - - static inline const VarType *internal_default_instance() { - return reinterpret_cast(&_VarType_default_instance_); - } - static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 12; - - void Swap(VarType *other); - friend void swap(VarType &a, VarType &b) { a.Swap(&b); } - - // implements Message - // ---------------------------------------------- - - inline VarType *New() const PROTOBUF_FINAL { return New(NULL); } - - VarType *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; - void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) - PROTOBUF_FINAL; - void CopyFrom(const VarType &from); - void MergeFrom(const VarType &from); - void Clear() PROTOBUF_FINAL; - bool IsInitialized() const PROTOBUF_FINAL; - - size_t ByteSizeLong() const PROTOBUF_FINAL; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; - void DiscardUnknownFields(); - int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(VarType *other); - - private: - inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } - inline void *MaybeArenaPtr() const { return NULL; } - - public: - ::std::string GetTypeName() const PROTOBUF_FINAL; - - // nested types - // ---------------------------------------------------- - - typedef VarType_TensorDesc TensorDesc; - typedef VarType_LoDTensorDesc LoDTensorDesc; - typedef VarType_LoDTensorArrayDesc LoDTensorArrayDesc; - typedef VarType_ReaderDesc ReaderDesc; - typedef VarType_ChannelDesc ChannelDesc; - typedef VarType_Tuple Tuple; - - typedef VarType_Type Type; - static const Type BOOL = VarType_Type_BOOL; - static const Type INT16 = VarType_Type_INT16; - static const Type INT32 = VarType_Type_INT32; - static const Type INT64 = VarType_Type_INT64; - static const Type FP16 = VarType_Type_FP16; - static const Type FP32 = VarType_Type_FP32; - static const Type FP64 = VarType_Type_FP64; - static const Type LOD_TENSOR = VarType_Type_LOD_TENSOR; - static const Type SELECTED_ROWS = VarType_Type_SELECTED_ROWS; - static const Type FEED_MINIBATCH = VarType_Type_FEED_MINIBATCH; - static const Type FETCH_LIST = VarType_Type_FETCH_LIST; - static const Type STEP_SCOPES = VarType_Type_STEP_SCOPES; - static const Type LOD_RANK_TABLE = VarType_Type_LOD_RANK_TABLE; - static const Type LOD_TENSOR_ARRAY = VarType_Type_LOD_TENSOR_ARRAY; - static const Type PLACE_LIST = VarType_Type_PLACE_LIST; - static const Type READER = VarType_Type_READER; - static const Type CHANNEL = VarType_Type_CHANNEL; - static const Type RAW = VarType_Type_RAW; - static const Type TUPLE = VarType_Type_TUPLE; - static inline bool Type_IsValid(int value) { - return VarType_Type_IsValid(value); + inline VarType &operator=(VarType &&from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) + InternalSwap(&from); + } else { + CopyFrom(from); } - static const Type Type_MIN = VarType_Type_Type_MIN; - static const Type Type_MAX = VarType_Type_Type_MAX; - static const int Type_ARRAYSIZE = VarType_Type_Type_ARRAYSIZE; - - // accessors - // ------------------------------------------------------- - - // optional .paddle_mobile.framework.proto.VarType.TensorDesc - // selected_rows = - // 2; - bool has_selected_rows() const; - void clear_selected_rows(); - static const int kSelectedRowsFieldNumber = 2; - const ::paddle_mobile::framework::proto::VarType_TensorDesc & - selected_rows() const; - ::paddle_mobile::framework::proto::VarType_TensorDesc * - mutable_selected_rows(); - ::paddle_mobile::framework::proto::VarType_TensorDesc * - release_selected_rows(); - void set_allocated_selected_rows( - ::paddle_mobile::framework::proto::VarType_TensorDesc *selected_rows); - - // optional .paddle_mobile.framework.proto.VarType.LoDTensorDesc - // lod_tensor = - // 3; - bool has_lod_tensor() const; - void clear_lod_tensor(); - static const int kLodTensorFieldNumber = 3; - const ::paddle_mobile::framework::proto::VarType_LoDTensorDesc & - lod_tensor() const; - ::paddle_mobile::framework::proto::VarType_LoDTensorDesc * - mutable_lod_tensor(); - ::paddle_mobile::framework::proto::VarType_LoDTensorDesc * - release_lod_tensor(); - void set_allocated_lod_tensor( - ::paddle_mobile::framework::proto::VarType_LoDTensorDesc *lod_tensor); - - // optional - // .paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc - // tensor_array = 4; - bool has_tensor_array() const; - void clear_tensor_array(); - static const int kTensorArrayFieldNumber = 4; - const ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc & - tensor_array() const; - ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc * - mutable_tensor_array(); - ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc * - release_tensor_array(); - void set_allocated_tensor_array( - ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc - *tensor_array); - - // optional .paddle_mobile.framework.proto.VarType.ReaderDesc - // reader = 5; - bool has_reader() const; - void clear_reader(); - static const int kReaderFieldNumber = 5; - const ::paddle_mobile::framework::proto::VarType_ReaderDesc &reader() const; - ::paddle_mobile::framework::proto::VarType_ReaderDesc *mutable_reader(); - ::paddle_mobile::framework::proto::VarType_ReaderDesc *release_reader(); - void set_allocated_reader( - ::paddle_mobile::framework::proto::VarType_ReaderDesc *reader); - - // optional .paddle_mobile.framework.proto.VarType.ChannelDesc - // channel = 6; - bool has_channel() const; - void clear_channel(); - static const int kChannelFieldNumber = 6; - const ::paddle_mobile::framework::proto::VarType_ChannelDesc & - channel() const; - ::paddle_mobile::framework::proto::VarType_ChannelDesc *mutable_channel(); - ::paddle_mobile::framework::proto::VarType_ChannelDesc *release_channel(); - void set_allocated_channel( - ::paddle_mobile::framework::proto::VarType_ChannelDesc *channel); - - // optional .paddle_mobile.framework.proto.VarType.Tuple tuple = - // 7; - bool has_tuple() const; - void clear_tuple(); - static const int kTupleFieldNumber = 7; - const ::paddle_mobile::framework::proto::VarType_Tuple &tuple() const; - ::paddle_mobile::framework::proto::VarType_Tuple *mutable_tuple(); - ::paddle_mobile::framework::proto::VarType_Tuple *release_tuple(); - void set_allocated_tuple( - ::paddle_mobile::framework::proto::VarType_Tuple *tuple); - - // required .paddle_mobile.framework.proto.VarType.Type type = - // 1; - bool has_type() const; - void clear_type(); - static const int kTypeFieldNumber = 1; - ::paddle_mobile::framework::proto::VarType_Type type() const; - void set_type(::paddle_mobile::framework::proto::VarType_Type value); - - // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType) - private: - void set_has_type(); - void clear_has_type(); - void set_has_selected_rows(); - void clear_has_selected_rows(); - void set_has_lod_tensor(); - void clear_has_lod_tensor(); - void set_has_tensor_array(); - void clear_has_tensor_array(); - void set_has_reader(); - void clear_has_reader(); - void set_has_channel(); - void clear_has_channel(); - void set_has_tuple(); - void clear_has_tuple(); - - ::google::protobuf::internal::InternalMetadataWithArenaLite - _internal_metadata_; - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable int _cached_size_; - ::paddle_mobile::framework::proto::VarType_TensorDesc *selected_rows_; - ::paddle_mobile::framework::proto::VarType_LoDTensorDesc *lod_tensor_; - ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc - *tensor_array_; - ::paddle_mobile::framework::proto::VarType_ReaderDesc *reader_; - ::paddle_mobile::framework::proto::VarType_ChannelDesc *channel_; - ::paddle_mobile::framework::proto::VarType_Tuple *tuple_; - int type_; - friend struct protobuf_framework_2eproto::TableStruct; + return *this; + } +#endif + inline const ::std::string &unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::std::string *mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const VarType &default_instance(); + + static inline const VarType *internal_default_instance() { + return reinterpret_cast(&_VarType_default_instance_); + } + static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 12; + + void Swap(VarType *other); + friend void swap(VarType &a, VarType &b) { a.Swap(&b); } + + // implements Message + // ---------------------------------------------- + + inline VarType *New() const PROTOBUF_FINAL { return New(NULL); } + + VarType *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) + PROTOBUF_FINAL; + void CopyFrom(const VarType &from); + void MergeFrom(const VarType &from); + void Clear() PROTOBUF_FINAL; + bool IsInitialized() const PROTOBUF_FINAL; + + size_t ByteSizeLong() const PROTOBUF_FINAL; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; + void DiscardUnknownFields(); + int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } + +private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(VarType *other); + +private: + inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } + inline void *MaybeArenaPtr() const { return NULL; } + +public: + ::std::string GetTypeName() const PROTOBUF_FINAL; + + // nested types + // ---------------------------------------------------- + + typedef VarType_TensorDesc TensorDesc; + typedef VarType_LoDTensorDesc LoDTensorDesc; + typedef VarType_LoDTensorArrayDesc LoDTensorArrayDesc; + typedef VarType_ReaderDesc ReaderDesc; + typedef VarType_ChannelDesc ChannelDesc; + typedef VarType_Tuple Tuple; + + typedef VarType_Type Type; + static const Type BOOL = VarType_Type_BOOL; + static const Type INT16 = VarType_Type_INT16; + static const Type INT32 = VarType_Type_INT32; + static const Type INT64 = VarType_Type_INT64; + static const Type FP16 = VarType_Type_FP16; + static const Type FP32 = VarType_Type_FP32; + static const Type FP64 = VarType_Type_FP64; + static const Type LOD_TENSOR = VarType_Type_LOD_TENSOR; + static const Type SELECTED_ROWS = VarType_Type_SELECTED_ROWS; + static const Type FEED_MINIBATCH = VarType_Type_FEED_MINIBATCH; + static const Type FETCH_LIST = VarType_Type_FETCH_LIST; + static const Type STEP_SCOPES = VarType_Type_STEP_SCOPES; + static const Type LOD_RANK_TABLE = VarType_Type_LOD_RANK_TABLE; + static const Type LOD_TENSOR_ARRAY = VarType_Type_LOD_TENSOR_ARRAY; + static const Type PLACE_LIST = VarType_Type_PLACE_LIST; + static const Type READER = VarType_Type_READER; + static const Type CHANNEL = VarType_Type_CHANNEL; + static const Type RAW = VarType_Type_RAW; + static const Type TUPLE = VarType_Type_TUPLE; + static inline bool Type_IsValid(int value) { + return VarType_Type_IsValid(value); + } + static const Type Type_MIN = VarType_Type_Type_MIN; + static const Type Type_MAX = VarType_Type_Type_MAX; + static const int Type_ARRAYSIZE = VarType_Type_Type_ARRAYSIZE; + + // accessors + // ------------------------------------------------------- + + // optional .paddle_mobile.framework.proto.VarType.TensorDesc + // selected_rows = + // 2; + bool has_selected_rows() const; + void clear_selected_rows(); + static const int kSelectedRowsFieldNumber = 2; + const ::paddle_mobile::framework::proto::VarType_TensorDesc & + selected_rows() const; + ::paddle_mobile::framework::proto::VarType_TensorDesc * + mutable_selected_rows(); + ::paddle_mobile::framework::proto::VarType_TensorDesc * + release_selected_rows(); + void set_allocated_selected_rows( + ::paddle_mobile::framework::proto::VarType_TensorDesc *selected_rows); + + // optional .paddle_mobile.framework.proto.VarType.LoDTensorDesc + // lod_tensor = + // 3; + bool has_lod_tensor() const; + void clear_lod_tensor(); + static const int kLodTensorFieldNumber = 3; + const ::paddle_mobile::framework::proto::VarType_LoDTensorDesc & + lod_tensor() const; + ::paddle_mobile::framework::proto::VarType_LoDTensorDesc * + mutable_lod_tensor(); + ::paddle_mobile::framework::proto::VarType_LoDTensorDesc * + release_lod_tensor(); + void set_allocated_lod_tensor( + ::paddle_mobile::framework::proto::VarType_LoDTensorDesc *lod_tensor); + + // optional + // .paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc + // tensor_array = 4; + bool has_tensor_array() const; + void clear_tensor_array(); + static const int kTensorArrayFieldNumber = 4; + const ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc & + tensor_array() const; + ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc * + mutable_tensor_array(); + ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc * + release_tensor_array(); + void set_allocated_tensor_array( + ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc + *tensor_array); + + // optional .paddle_mobile.framework.proto.VarType.ReaderDesc + // reader = 5; + bool has_reader() const; + void clear_reader(); + static const int kReaderFieldNumber = 5; + const ::paddle_mobile::framework::proto::VarType_ReaderDesc &reader() const; + ::paddle_mobile::framework::proto::VarType_ReaderDesc *mutable_reader(); + ::paddle_mobile::framework::proto::VarType_ReaderDesc *release_reader(); + void set_allocated_reader( + ::paddle_mobile::framework::proto::VarType_ReaderDesc *reader); + + // optional .paddle_mobile.framework.proto.VarType.ChannelDesc + // channel = 6; + bool has_channel() const; + void clear_channel(); + static const int kChannelFieldNumber = 6; + const ::paddle_mobile::framework::proto::VarType_ChannelDesc &channel() const; + ::paddle_mobile::framework::proto::VarType_ChannelDesc *mutable_channel(); + ::paddle_mobile::framework::proto::VarType_ChannelDesc *release_channel(); + void set_allocated_channel( + ::paddle_mobile::framework::proto::VarType_ChannelDesc *channel); + + // optional .paddle_mobile.framework.proto.VarType.Tuple tuple = + // 7; + bool has_tuple() const; + void clear_tuple(); + static const int kTupleFieldNumber = 7; + const ::paddle_mobile::framework::proto::VarType_Tuple &tuple() const; + ::paddle_mobile::framework::proto::VarType_Tuple *mutable_tuple(); + ::paddle_mobile::framework::proto::VarType_Tuple *release_tuple(); + void + set_allocated_tuple(::paddle_mobile::framework::proto::VarType_Tuple *tuple); + + // required .paddle_mobile.framework.proto.VarType.Type type = + // 1; + bool has_type() const; + void clear_type(); + static const int kTypeFieldNumber = 1; + ::paddle_mobile::framework::proto::VarType_Type type() const; + void set_type(::paddle_mobile::framework::proto::VarType_Type value); + + // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarType) +private: + void set_has_type(); + void clear_has_type(); + void set_has_selected_rows(); + void clear_has_selected_rows(); + void set_has_lod_tensor(); + void clear_has_lod_tensor(); + void set_has_tensor_array(); + void clear_has_tensor_array(); + void set_has_reader(); + void clear_has_reader(); + void set_has_channel(); + void clear_has_channel(); + void set_has_tuple(); + void clear_has_tuple(); + + ::google::protobuf::internal::InternalMetadataWithArenaLite + _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::paddle_mobile::framework::proto::VarType_TensorDesc *selected_rows_; + ::paddle_mobile::framework::proto::VarType_LoDTensorDesc *lod_tensor_; + ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc *tensor_array_; + ::paddle_mobile::framework::proto::VarType_ReaderDesc *reader_; + ::paddle_mobile::framework::proto::VarType_ChannelDesc *channel_; + ::paddle_mobile::framework::proto::VarType_Tuple *tuple_; + int type_; + friend struct protobuf_framework_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -2256,137 +2235,137 @@ class VarDesc MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.VarDesc) */ { - public: - VarDesc(); - virtual ~VarDesc(); +public: + VarDesc(); + virtual ~VarDesc(); - VarDesc(const VarDesc &from); + VarDesc(const VarDesc &from); - inline VarDesc &operator=(const VarDesc &from) { - CopyFrom(from); - return *this; - } + inline VarDesc &operator=(const VarDesc &from) { + CopyFrom(from); + return *this; + } #if LANG_CXX11 - VarDesc(VarDesc &&from) noexcept : VarDesc() { *this = ::std::move(from); } - - inline VarDesc &operator=(VarDesc &&from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } -#endif - inline const ::std::string &unknown_fields() const { - return _internal_metadata_.unknown_fields(); - } - inline ::std::string *mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); - } - - static const VarDesc &default_instance(); + VarDesc(VarDesc &&from) noexcept : VarDesc() { *this = ::std::move(from); } - static inline const VarDesc *internal_default_instance() { - return reinterpret_cast(&_VarDesc_default_instance_); + inline VarDesc &operator=(VarDesc &&from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) + InternalSwap(&from); + } else { + CopyFrom(from); } - static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 13; - - void Swap(VarDesc *other); - friend void swap(VarDesc &a, VarDesc &b) { a.Swap(&b); } - - // implements Message - // ---------------------------------------------- - - inline VarDesc *New() const PROTOBUF_FINAL { return New(NULL); } - - VarDesc *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; - void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) - PROTOBUF_FINAL; - void CopyFrom(const VarDesc &from); - void MergeFrom(const VarDesc &from); - void Clear() PROTOBUF_FINAL; - bool IsInitialized() const PROTOBUF_FINAL; - - size_t ByteSizeLong() const PROTOBUF_FINAL; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; - void DiscardUnknownFields(); - int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(VarDesc *other); - - private: - inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } - inline void *MaybeArenaPtr() const { return NULL; } - - public: - ::std::string GetTypeName() const PROTOBUF_FINAL; - - // nested types - // ---------------------------------------------------- - - // accessors - // ------------------------------------------------------- - - // required 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); + return *this; + } +#endif + inline const ::std::string &unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::std::string *mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const VarDesc &default_instance(); + + static inline const VarDesc *internal_default_instance() { + return reinterpret_cast(&_VarDesc_default_instance_); + } + static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 13; + + void Swap(VarDesc *other); + friend void swap(VarDesc &a, VarDesc &b) { a.Swap(&b); } + + // implements Message + // ---------------------------------------------- + + inline VarDesc *New() const PROTOBUF_FINAL { return New(NULL); } + + VarDesc *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) + PROTOBUF_FINAL; + void CopyFrom(const VarDesc &from); + void MergeFrom(const VarDesc &from); + void Clear() PROTOBUF_FINAL; + bool IsInitialized() const PROTOBUF_FINAL; + + size_t ByteSizeLong() const PROTOBUF_FINAL; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; + void DiscardUnknownFields(); + int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } + +private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(VarDesc *other); + +private: + inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } + inline void *MaybeArenaPtr() const { return NULL; } + +public: + ::std::string GetTypeName() const PROTOBUF_FINAL; + + // nested types + // ---------------------------------------------------- + + // accessors + // ------------------------------------------------------- + + // required 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); #if LANG_CXX11 - void set_name(::std::string &&value); + void set_name(::std::string &&value); #endif - 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); - - // required .paddle_mobile.framework.proto.VarType type = 2; - bool has_type() const; - void clear_type(); - static const int kTypeFieldNumber = 2; - const ::paddle_mobile::framework::proto::VarType &type() const; - ::paddle_mobile::framework::proto::VarType *mutable_type(); - ::paddle_mobile::framework::proto::VarType *release_type(); - void set_allocated_type(::paddle_mobile::framework::proto::VarType *type); - - // optional bool persistable = 3 [default = false]; - bool has_persistable() const; - void clear_persistable(); - static const int kPersistableFieldNumber = 3; - bool persistable() const; - void set_persistable(bool value); - - // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarDesc) - private: - void set_has_name(); - void clear_has_name(); - void set_has_type(); - void clear_has_type(); - void set_has_persistable(); - void clear_has_persistable(); - - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - - ::google::protobuf::internal::InternalMetadataWithArenaLite - _internal_metadata_; - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable int _cached_size_; - ::google::protobuf::internal::ArenaStringPtr name_; - ::paddle_mobile::framework::proto::VarType *type_; - bool persistable_; - friend struct protobuf_framework_2eproto::TableStruct; + 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); + + // required .paddle_mobile.framework.proto.VarType type = 2; + bool has_type() const; + void clear_type(); + static const int kTypeFieldNumber = 2; + const ::paddle_mobile::framework::proto::VarType &type() const; + ::paddle_mobile::framework::proto::VarType *mutable_type(); + ::paddle_mobile::framework::proto::VarType *release_type(); + void set_allocated_type(::paddle_mobile::framework::proto::VarType *type); + + // optional bool persistable = 3 [default = false]; + bool has_persistable() const; + void clear_persistable(); + static const int kPersistableFieldNumber = 3; + bool persistable() const; + void set_persistable(bool value); + + // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.VarDesc) +private: + void set_has_name(); + void clear_has_name(); + void set_has_type(); + void clear_has_type(); + void set_has_persistable(); + void clear_has_persistable(); + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + ::google::protobuf::internal::InternalMetadataWithArenaLite + _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::paddle_mobile::framework::proto::VarType *type_; + bool persistable_; + friend struct protobuf_framework_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -2395,164 +2374,163 @@ class BlockDesc MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.BlockDesc) */ { - public: - BlockDesc(); - virtual ~BlockDesc(); +public: + BlockDesc(); + virtual ~BlockDesc(); - BlockDesc(const BlockDesc &from); + BlockDesc(const BlockDesc &from); - inline BlockDesc &operator=(const BlockDesc &from) { - CopyFrom(from); - return *this; - } + inline BlockDesc &operator=(const BlockDesc &from) { + CopyFrom(from); + return *this; + } #if LANG_CXX11 - BlockDesc(BlockDesc &&from) noexcept : BlockDesc() { - *this = ::std::move(from); - } - - inline BlockDesc &operator=(BlockDesc &&from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; + BlockDesc(BlockDesc &&from) noexcept : BlockDesc() { + *this = ::std::move(from); + } + + inline BlockDesc &operator=(BlockDesc &&from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) + InternalSwap(&from); + } else { + CopyFrom(from); } + return *this; + } #endif - inline const ::std::string &unknown_fields() const { - return _internal_metadata_.unknown_fields(); - } - inline ::std::string *mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); - } - - static const BlockDesc &default_instance(); - - static inline const BlockDesc *internal_default_instance() { - return reinterpret_cast( - &_BlockDesc_default_instance_); - } - static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 14; - - void Swap(BlockDesc *other); - friend void swap(BlockDesc &a, BlockDesc &b) { a.Swap(&b); } - - // implements Message - // ---------------------------------------------- - - inline BlockDesc *New() const PROTOBUF_FINAL { return New(NULL); } - - BlockDesc *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; - void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) - PROTOBUF_FINAL; - void CopyFrom(const BlockDesc &from); - void MergeFrom(const BlockDesc &from); - void Clear() PROTOBUF_FINAL; - bool IsInitialized() const PROTOBUF_FINAL; - - size_t ByteSizeLong() const PROTOBUF_FINAL; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; - void DiscardUnknownFields(); - int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(BlockDesc *other); - - private: - inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } - inline void *MaybeArenaPtr() const { return NULL; } - - public: - ::std::string GetTypeName() const PROTOBUF_FINAL; - - // nested types - // ---------------------------------------------------- - - // accessors - // ------------------------------------------------------- - - // repeated .paddle_mobile.framework.proto.VarDesc vars = 3; - int vars_size() const; - void clear_vars(); - static const int kVarsFieldNumber = 3; - const ::paddle_mobile::framework::proto::VarDesc &vars(int index) const; - ::paddle_mobile::framework::proto::VarDesc *mutable_vars(int index); - ::paddle_mobile::framework::proto::VarDesc *add_vars(); - ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::VarDesc> * - mutable_vars(); - const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::VarDesc> & - vars() const; - - // repeated .paddle_mobile.framework.proto.OpDesc ops = 4; - int ops_size() const; - void clear_ops(); - static const int kOpsFieldNumber = 4; - const ::paddle_mobile::framework::proto::OpDesc &ops(int index) const; - ::paddle_mobile::framework::proto::OpDesc *mutable_ops(int index); - ::paddle_mobile::framework::proto::OpDesc *add_ops(); - ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc> * - mutable_ops(); - const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc> & - ops() const; - - // required int32 idx = 1; - bool has_idx() const; - void clear_idx(); - static const int kIdxFieldNumber = 1; - ::google::protobuf::int32 idx() const; - void set_idx(::google::protobuf::int32 value); - - // required int32 parent_idx = 2; - bool has_parent_idx() const; - void clear_parent_idx(); - static const int kParentIdxFieldNumber = 2; - ::google::protobuf::int32 parent_idx() const; - void set_parent_idx(::google::protobuf::int32 value); - - // optional int32 forward_block_idx = 5 [default = -1]; - bool has_forward_block_idx() const; - void clear_forward_block_idx(); - static const int kForwardBlockIdxFieldNumber = 5; - ::google::protobuf::int32 forward_block_idx() const; - void set_forward_block_idx(::google::protobuf::int32 value); - - // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.BlockDesc) - private: - void set_has_idx(); - void clear_has_idx(); - void set_has_parent_idx(); - void clear_has_parent_idx(); - void set_has_forward_block_idx(); - void clear_has_forward_block_idx(); - - // helper for ByteSizeLong() - size_t RequiredFieldsByteSizeFallback() const; - - ::google::protobuf::internal::InternalMetadataWithArenaLite - _internal_metadata_; - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable int _cached_size_; - ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::VarDesc> - vars_; - ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::OpDesc> - ops_; - ::google::protobuf::int32 idx_; - ::google::protobuf::int32 parent_idx_; - ::google::protobuf::int32 forward_block_idx_; - friend struct protobuf_framework_2eproto::TableStruct; + inline const ::std::string &unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::std::string *mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const BlockDesc &default_instance(); + + static inline const BlockDesc *internal_default_instance() { + return reinterpret_cast(&_BlockDesc_default_instance_); + } + static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 14; + + void Swap(BlockDesc *other); + friend void swap(BlockDesc &a, BlockDesc &b) { a.Swap(&b); } + + // implements Message + // ---------------------------------------------- + + inline BlockDesc *New() const PROTOBUF_FINAL { return New(NULL); } + + BlockDesc *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) + PROTOBUF_FINAL; + void CopyFrom(const BlockDesc &from); + void MergeFrom(const BlockDesc &from); + void Clear() PROTOBUF_FINAL; + bool IsInitialized() const PROTOBUF_FINAL; + + size_t ByteSizeLong() const PROTOBUF_FINAL; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; + void DiscardUnknownFields(); + int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } + +private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(BlockDesc *other); + +private: + inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } + inline void *MaybeArenaPtr() const { return NULL; } + +public: + ::std::string GetTypeName() const PROTOBUF_FINAL; + + // nested types + // ---------------------------------------------------- + + // accessors + // ------------------------------------------------------- + + // repeated .paddle_mobile.framework.proto.VarDesc vars = 3; + int vars_size() const; + void clear_vars(); + static const int kVarsFieldNumber = 3; + const ::paddle_mobile::framework::proto::VarDesc &vars(int index) const; + ::paddle_mobile::framework::proto::VarDesc *mutable_vars(int index); + ::paddle_mobile::framework::proto::VarDesc *add_vars(); + ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::VarDesc> * + mutable_vars(); + const ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::VarDesc> & + vars() const; + + // repeated .paddle_mobile.framework.proto.OpDesc ops = 4; + int ops_size() const; + void clear_ops(); + static const int kOpsFieldNumber = 4; + const ::paddle_mobile::framework::proto::OpDesc &ops(int index) const; + ::paddle_mobile::framework::proto::OpDesc *mutable_ops(int index); + ::paddle_mobile::framework::proto::OpDesc *add_ops(); + ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpDesc> * + mutable_ops(); + const ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpDesc> & + ops() const; + + // required int32 idx = 1; + bool has_idx() const; + void clear_idx(); + static const int kIdxFieldNumber = 1; + ::google::protobuf::int32 idx() const; + void set_idx(::google::protobuf::int32 value); + + // required int32 parent_idx = 2; + bool has_parent_idx() const; + void clear_parent_idx(); + static const int kParentIdxFieldNumber = 2; + ::google::protobuf::int32 parent_idx() const; + void set_parent_idx(::google::protobuf::int32 value); + + // optional int32 forward_block_idx = 5 [default = -1]; + bool has_forward_block_idx() const; + void clear_forward_block_idx(); + static const int kForwardBlockIdxFieldNumber = 5; + ::google::protobuf::int32 forward_block_idx() const; + void set_forward_block_idx(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.BlockDesc) +private: + void set_has_idx(); + void clear_has_idx(); + void set_has_parent_idx(); + void clear_has_parent_idx(); + void set_has_forward_block_idx(); + void clear_has_forward_block_idx(); + + // helper for ByteSizeLong() + size_t RequiredFieldsByteSizeFallback() const; + + ::google::protobuf::internal::InternalMetadataWithArenaLite + _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::VarDesc> + vars_; + ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::OpDesc> + ops_; + ::google::protobuf::int32 idx_; + ::google::protobuf::int32 parent_idx_; + ::google::protobuf::int32 forward_block_idx_; + friend struct protobuf_framework_2eproto::TableStruct; }; // ------------------------------------------------------------------- @@ -2561,113 +2539,113 @@ class ProgramDesc MessageLite /* @@protoc_insertion_point(class_definition:paddle_mobile.framework.proto.ProgramDesc) */ { - public: - ProgramDesc(); - virtual ~ProgramDesc(); +public: + ProgramDesc(); + virtual ~ProgramDesc(); - ProgramDesc(const ProgramDesc &from); + ProgramDesc(const ProgramDesc &from); - inline ProgramDesc &operator=(const ProgramDesc &from) { - CopyFrom(from); - return *this; - } + inline ProgramDesc &operator=(const ProgramDesc &from) { + CopyFrom(from); + return *this; + } #if LANG_CXX11 - ProgramDesc(ProgramDesc &&from) noexcept : ProgramDesc() { - *this = ::std::move(from); - } - - inline ProgramDesc &operator=(ProgramDesc &&from) noexcept { - if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { - if (this != &from) - InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; + ProgramDesc(ProgramDesc &&from) noexcept : ProgramDesc() { + *this = ::std::move(from); + } + + inline ProgramDesc &operator=(ProgramDesc &&from) noexcept { + if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { + if (this != &from) + InternalSwap(&from); + } else { + CopyFrom(from); } + return *this; + } #endif - inline const ::std::string &unknown_fields() const { - return _internal_metadata_.unknown_fields(); - } - inline ::std::string *mutable_unknown_fields() { - return _internal_metadata_.mutable_unknown_fields(); - } - - static const ProgramDesc &default_instance(); - - static inline const ProgramDesc *internal_default_instance() { - return reinterpret_cast( - &_ProgramDesc_default_instance_); - } - static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 15; - - void Swap(ProgramDesc *other); - friend void swap(ProgramDesc &a, ProgramDesc &b) { a.Swap(&b); } - - // implements Message - // ---------------------------------------------- - - inline ProgramDesc *New() const PROTOBUF_FINAL { return New(NULL); } - - ProgramDesc *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; - void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) - PROTOBUF_FINAL; - void CopyFrom(const ProgramDesc &from); - void MergeFrom(const ProgramDesc &from); - void Clear() PROTOBUF_FINAL; - bool IsInitialized() const PROTOBUF_FINAL; - - size_t ByteSizeLong() const PROTOBUF_FINAL; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; - void DiscardUnknownFields(); - int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } - - private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; - void InternalSwap(ProgramDesc *other); - - private: - inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } - inline void *MaybeArenaPtr() const { return NULL; } - - public: - ::std::string GetTypeName() const PROTOBUF_FINAL; - - // nested types - // ---------------------------------------------------- - - // accessors - // ------------------------------------------------------- - - // repeated .paddle_mobile.framework.proto.BlockDesc blocks = 1; - int blocks_size() const; - void clear_blocks(); - static const int kBlocksFieldNumber = 1; - const ::paddle_mobile::framework::proto::BlockDesc &blocks(int index) const; - ::paddle_mobile::framework::proto::BlockDesc *mutable_blocks(int index); - ::paddle_mobile::framework::proto::BlockDesc *add_blocks(); - ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::BlockDesc> * - mutable_blocks(); - const ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::BlockDesc> & - blocks() const; - - // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.ProgramDesc) - private: - ::google::protobuf::internal::InternalMetadataWithArenaLite - _internal_metadata_; - ::google::protobuf::internal::HasBits<1> _has_bits_; - mutable int _cached_size_; - ::google::protobuf::RepeatedPtrField< - ::paddle_mobile::framework::proto::BlockDesc> - blocks_; - friend struct protobuf_framework_2eproto::TableStruct; + inline const ::std::string &unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + inline ::std::string *mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ProgramDesc &default_instance(); + + static inline const ProgramDesc *internal_default_instance() { + return reinterpret_cast( + &_ProgramDesc_default_instance_); + } + static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 15; + + void Swap(ProgramDesc *other); + friend void swap(ProgramDesc &a, ProgramDesc &b) { a.Swap(&b); } + + // implements Message + // ---------------------------------------------- + + inline ProgramDesc *New() const PROTOBUF_FINAL { return New(NULL); } + + ProgramDesc *New(::google::protobuf::Arena *arena) const PROTOBUF_FINAL; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite &from) + PROTOBUF_FINAL; + void CopyFrom(const ProgramDesc &from); + void MergeFrom(const ProgramDesc &from); + void Clear() PROTOBUF_FINAL; + bool IsInitialized() const PROTOBUF_FINAL; + + size_t ByteSizeLong() const PROTOBUF_FINAL; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream *input) PROTOBUF_FINAL; + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream *output) const PROTOBUF_FINAL; + void DiscardUnknownFields(); + int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } + +private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ProgramDesc *other); + +private: + inline ::google::protobuf::Arena *GetArenaNoVirtual() const { return NULL; } + inline void *MaybeArenaPtr() const { return NULL; } + +public: + ::std::string GetTypeName() const PROTOBUF_FINAL; + + // nested types + // ---------------------------------------------------- + + // accessors + // ------------------------------------------------------- + + // repeated .paddle_mobile.framework.proto.BlockDesc blocks = 1; + int blocks_size() const; + void clear_blocks(); + static const int kBlocksFieldNumber = 1; + const ::paddle_mobile::framework::proto::BlockDesc &blocks(int index) const; + ::paddle_mobile::framework::proto::BlockDesc *mutable_blocks(int index); + ::paddle_mobile::framework::proto::BlockDesc *add_blocks(); + ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::BlockDesc> * + mutable_blocks(); + const ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::BlockDesc> & + blocks() const; + + // @@protoc_insertion_point(class_scope:paddle_mobile.framework.proto.ProgramDesc) +private: + ::google::protobuf::internal::InternalMetadataWithArenaLite + _internal_metadata_; + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< + ::paddle_mobile::framework::proto::BlockDesc> + blocks_; + friend struct protobuf_framework_2eproto::TableStruct; }; // =================================================================== @@ -2682,401 +2660,397 @@ class ProgramDesc // required string name = 1; inline bool OpDesc_Attr::has_name() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } inline void OpDesc_Attr::set_has_name() { _has_bits_[0] |= 0x00000001u; } inline void OpDesc_Attr::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void OpDesc_Attr::clear_name() { - name_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_name(); + name_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); } inline const ::std::string &OpDesc_Attr::name() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.name) - return name_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.name) + return name_.GetNoArena(); } inline void OpDesc_Attr::set_name(const ::std::string &value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.name) } #if LANG_CXX11 inline void OpDesc_Attr::set_name(::std::string &&value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpDesc.Attr.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpDesc.Attr.name) } #endif inline void OpDesc_Attr::set_name(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Attr.name) + GOOGLE_DCHECK(value != NULL); + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Attr.name) } inline void OpDesc_Attr::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:paddle_mobile.framework.proto.OpDesc.Attr.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Attr.name) } inline ::std::string *OpDesc_Attr::mutable_name() { - set_has_name(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Attr.name) - return name_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_name(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Attr.name) + return name_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline ::std::string *OpDesc_Attr::release_name() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpDesc.Attr.name) - clear_has_name(); - return name_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpDesc.Attr.name) + clear_has_name(); + return name_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void OpDesc_Attr::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:paddle_mobile.framework.proto.OpDesc.Attr.name) + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpDesc.Attr.name) } // required .paddle_mobile.framework.proto.AttrType type = 2; inline bool OpDesc_Attr::has_type() const { - return (_has_bits_[0] & 0x00000004u) != 0; + return (_has_bits_[0] & 0x00000004u) != 0; } inline void OpDesc_Attr::set_has_type() { _has_bits_[0] |= 0x00000004u; } inline void OpDesc_Attr::clear_has_type() { _has_bits_[0] &= ~0x00000004u; } inline void OpDesc_Attr::clear_type() { - type_ = 0; - clear_has_type(); + type_ = 0; + clear_has_type(); } inline ::paddle_mobile::framework::proto::AttrType OpDesc_Attr::type() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.type) - return static_cast<::paddle_mobile::framework::proto::AttrType>(type_); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.type) + return static_cast<::paddle_mobile::framework::proto::AttrType>(type_); } inline void OpDesc_Attr::set_type(::paddle_mobile::framework::proto::AttrType value) { - assert(::paddle_mobile::framework::proto::AttrType_IsValid(value)); - set_has_type(); - type_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.type) + assert(::paddle_mobile::framework::proto::AttrType_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.type) } // optional int32 i = 3; inline bool OpDesc_Attr::has_i() const { - return (_has_bits_[0] & 0x00000008u) != 0; + return (_has_bits_[0] & 0x00000008u) != 0; } inline void OpDesc_Attr::set_has_i() { _has_bits_[0] |= 0x00000008u; } inline void OpDesc_Attr::clear_has_i() { _has_bits_[0] &= ~0x00000008u; } inline void OpDesc_Attr::clear_i() { - i_ = 0; - clear_has_i(); + i_ = 0; + clear_has_i(); } inline ::google::protobuf::int32 OpDesc_Attr::i() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.i) - return i_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.i) + return i_; } inline void OpDesc_Attr::set_i(::google::protobuf::int32 value) { - set_has_i(); - i_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.i) + set_has_i(); + i_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.i) } // optional float f = 4; inline bool OpDesc_Attr::has_f() const { - return (_has_bits_[0] & 0x00000010u) != 0; + return (_has_bits_[0] & 0x00000010u) != 0; } inline void OpDesc_Attr::set_has_f() { _has_bits_[0] |= 0x00000010u; } inline void OpDesc_Attr::clear_has_f() { _has_bits_[0] &= ~0x00000010u; } inline void OpDesc_Attr::clear_f() { - f_ = 0; - clear_has_f(); + f_ = 0; + clear_has_f(); } inline float OpDesc_Attr::f() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.f) - return f_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.f) + return f_; } inline void OpDesc_Attr::set_f(float value) { - set_has_f(); - f_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.f) + set_has_f(); + f_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.f) } // optional string s = 5; inline bool OpDesc_Attr::has_s() const { - return (_has_bits_[0] & 0x00000002u) != 0; + return (_has_bits_[0] & 0x00000002u) != 0; } inline void OpDesc_Attr::set_has_s() { _has_bits_[0] |= 0x00000002u; } inline void OpDesc_Attr::clear_has_s() { _has_bits_[0] &= ~0x00000002u; } inline void OpDesc_Attr::clear_s() { - s_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_s(); + s_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_s(); } inline const ::std::string &OpDesc_Attr::s() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.s) - return s_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.s) + return s_.GetNoArena(); } inline void OpDesc_Attr::set_s(const ::std::string &value) { - set_has_s(); - s_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.s) + set_has_s(); + s_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.s) } #if LANG_CXX11 inline void OpDesc_Attr::set_s(::std::string &&value) { - set_has_s(); - s_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpDesc.Attr.s) + set_has_s(); + s_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpDesc.Attr.s) } #endif inline void OpDesc_Attr::set_s(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_s(); - s_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Attr.s) + GOOGLE_DCHECK(value != NULL); + set_has_s(); + s_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Attr.s) } inline void OpDesc_Attr::set_s(const char *value, size_t size) { - set_has_s(); - s_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Attr.s) + set_has_s(); + s_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Attr.s) } inline ::std::string *OpDesc_Attr::mutable_s() { - set_has_s(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Attr.s) - return s_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_s(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Attr.s) + return s_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline ::std::string *OpDesc_Attr::release_s() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpDesc.Attr.s) - clear_has_s(); - return s_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpDesc.Attr.s) + clear_has_s(); + return s_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void OpDesc_Attr::set_allocated_s(::std::string *s) { - if (s != NULL) { - set_has_s(); - } else { - clear_has_s(); - } - s_.SetAllocatedNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), s); - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpDesc.Attr.s) + if (s != NULL) { + set_has_s(); + } else { + clear_has_s(); + } + s_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), s); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpDesc.Attr.s) } // repeated int32 ints = 6; inline int OpDesc_Attr::ints_size() const { return ints_.size(); } inline void OpDesc_Attr::clear_ints() { ints_.Clear(); } inline ::google::protobuf::int32 OpDesc_Attr::ints(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.ints) - return ints_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.ints) + return ints_.Get(index); } inline void OpDesc_Attr::set_ints(int index, ::google::protobuf::int32 value) { - ints_.Set(index, value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.ints) + ints_.Set(index, value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.ints) } inline void OpDesc_Attr::add_ints(::google::protobuf::int32 value) { - ints_.Add(value); - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.ints) + ints_.Add(value); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.ints) } inline const ::google::protobuf::RepeatedField<::google::protobuf::int32> & OpDesc_Attr::ints() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.ints) - return ints_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.ints) + return ints_; } inline ::google::protobuf::RepeatedField<::google::protobuf::int32> * OpDesc_Attr::mutable_ints() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.ints) - return &ints_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.ints) + return &ints_; } // repeated float floats = 7; inline int OpDesc_Attr::floats_size() const { return floats_.size(); } inline void OpDesc_Attr::clear_floats() { floats_.Clear(); } inline float OpDesc_Attr::floats(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.floats) - return floats_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.floats) + return floats_.Get(index); } inline void OpDesc_Attr::set_floats(int index, float value) { - floats_.Set(index, value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.floats) + floats_.Set(index, value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.floats) } inline void OpDesc_Attr::add_floats(float value) { - floats_.Add(value); - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.floats) + floats_.Add(value); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.floats) } inline const ::google::protobuf::RepeatedField & OpDesc_Attr::floats() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.floats) - return floats_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.floats) + return floats_; } inline ::google::protobuf::RepeatedField *OpDesc_Attr::mutable_floats() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.floats) - return &floats_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.floats) + return &floats_; } // repeated string strings = 8; inline int OpDesc_Attr::strings_size() const { return strings_.size(); } inline void OpDesc_Attr::clear_strings() { strings_.Clear(); } inline const ::std::string &OpDesc_Attr::strings(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.strings) - return strings_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.strings) + return strings_.Get(index); } inline ::std::string *OpDesc_Attr::mutable_strings(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Attr.strings) - return strings_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Attr.strings) + return strings_.Mutable(index); } inline void OpDesc_Attr::set_strings(int index, const ::std::string &value) { - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.strings) - strings_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.strings) + strings_.Mutable(index)->assign(value); } #if LANG_CXX11 inline void OpDesc_Attr::set_strings(int index, ::std::string &&value) { - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.strings) - strings_.Mutable(index)->assign(std::move(value)); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.strings) + strings_.Mutable(index)->assign(std::move(value)); } #endif inline void OpDesc_Attr::set_strings(int index, const char *value) { - GOOGLE_DCHECK(value != NULL); - strings_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Attr.strings) + GOOGLE_DCHECK(value != NULL); + strings_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Attr.strings) } inline void OpDesc_Attr::set_strings(int index, const char *value, size_t size) { - strings_.Mutable(index)->assign(reinterpret_cast(value), - size); - // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Attr.strings) + strings_.Mutable(index)->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Attr.strings) } inline ::std::string *OpDesc_Attr::add_strings() { - // @@protoc_insertion_point(field_add_mutable:paddle_mobile.framework.proto.OpDesc.Attr.strings) - return strings_.Add(); + // @@protoc_insertion_point(field_add_mutable:paddle_mobile.framework.proto.OpDesc.Attr.strings) + return strings_.Add(); } inline void OpDesc_Attr::add_strings(const ::std::string &value) { - strings_.Add()->assign(value); - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.strings) + strings_.Add()->assign(value); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.strings) } #if LANG_CXX11 inline void OpDesc_Attr::add_strings(::std::string &&value) { - strings_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.strings) + strings_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.strings) } #endif inline void OpDesc_Attr::add_strings(const char *value) { - GOOGLE_DCHECK(value != NULL); - strings_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:paddle_mobile.framework.proto.OpDesc.Attr.strings) + GOOGLE_DCHECK(value != NULL); + strings_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:paddle_mobile.framework.proto.OpDesc.Attr.strings) } inline void OpDesc_Attr::add_strings(const char *value, size_t size) { - strings_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:paddle_mobile.framework.proto.OpDesc.Attr.strings) + strings_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:paddle_mobile.framework.proto.OpDesc.Attr.strings) } inline const ::google::protobuf::RepeatedPtrField<::std::string> & OpDesc_Attr::strings() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.strings) - return strings_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.strings) + return strings_; } inline ::google::protobuf::RepeatedPtrField<::std::string> * OpDesc_Attr::mutable_strings() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.strings) - return &strings_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.strings) + return &strings_; } // optional bool b = 10; inline bool OpDesc_Attr::has_b() const { - return (_has_bits_[0] & 0x00000020u) != 0; + return (_has_bits_[0] & 0x00000020u) != 0; } inline void OpDesc_Attr::set_has_b() { _has_bits_[0] |= 0x00000020u; } inline void OpDesc_Attr::clear_has_b() { _has_bits_[0] &= ~0x00000020u; } inline void OpDesc_Attr::clear_b() { - b_ = false; - clear_has_b(); + b_ = false; + clear_has_b(); } inline bool OpDesc_Attr::b() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.b) - return b_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.b) + return b_; } inline void OpDesc_Attr::set_b(bool value) { - set_has_b(); - b_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.b) + set_has_b(); + b_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.b) } // repeated bool bools = 11; inline int OpDesc_Attr::bools_size() const { return bools_.size(); } inline void OpDesc_Attr::clear_bools() { bools_.Clear(); } inline bool OpDesc_Attr::bools(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.bools) - return bools_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.bools) + return bools_.Get(index); } inline void OpDesc_Attr::set_bools(int index, bool value) { - bools_.Set(index, value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.bools) + bools_.Set(index, value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.bools) } inline void OpDesc_Attr::add_bools(bool value) { - bools_.Add(value); - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.bools) + bools_.Add(value); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Attr.bools) } inline const ::google::protobuf::RepeatedField & OpDesc_Attr::bools() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.bools) - return bools_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Attr.bools) + return bools_; } inline ::google::protobuf::RepeatedField *OpDesc_Attr::mutable_bools() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.bools) - return &bools_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Attr.bools) + return &bools_; } // optional int32 block_idx = 12; inline bool OpDesc_Attr::has_block_idx() const { - return (_has_bits_[0] & 0x00000080u) != 0; + return (_has_bits_[0] & 0x00000080u) != 0; } inline void OpDesc_Attr::set_has_block_idx() { _has_bits_[0] |= 0x00000080u; } inline void OpDesc_Attr::clear_has_block_idx() { - _has_bits_[0] &= ~0x00000080u; + _has_bits_[0] &= ~0x00000080u; } inline void OpDesc_Attr::clear_block_idx() { - block_idx_ = 0; - clear_has_block_idx(); + block_idx_ = 0; + clear_has_block_idx(); } inline ::google::protobuf::int32 OpDesc_Attr::block_idx() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.block_idx) - return block_idx_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.block_idx) + return block_idx_; } inline void OpDesc_Attr::set_block_idx(::google::protobuf::int32 value) { - set_has_block_idx(); - block_idx_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.block_idx) + set_has_block_idx(); + block_idx_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.block_idx) } // optional int64 l = 13; inline bool OpDesc_Attr::has_l() const { - return (_has_bits_[0] & 0x00000040u) != 0; + return (_has_bits_[0] & 0x00000040u) != 0; } inline void OpDesc_Attr::set_has_l() { _has_bits_[0] |= 0x00000040u; } inline void OpDesc_Attr::clear_has_l() { _has_bits_[0] &= ~0x00000040u; } inline void OpDesc_Attr::clear_l() { - l_ = GOOGLE_LONGLONG(0); - clear_has_l(); + l_ = GOOGLE_LONGLONG(0); + clear_has_l(); } inline ::google::protobuf::int64 OpDesc_Attr::l() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.l) - return l_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Attr.l) + return l_; } inline void OpDesc_Attr::set_l(::google::protobuf::int64 value) { - set_has_l(); - l_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.l) + set_has_l(); + l_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Attr.l) } // ------------------------------------------------------------------- @@ -3085,137 +3059,136 @@ inline void OpDesc_Attr::set_l(::google::protobuf::int64 value) { // required string parameter = 1; inline bool OpDesc_Var::has_parameter() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } inline void OpDesc_Var::set_has_parameter() { _has_bits_[0] |= 0x00000001u; } inline void OpDesc_Var::clear_has_parameter() { _has_bits_[0] &= ~0x00000001u; } inline void OpDesc_Var::clear_parameter() { - parameter_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_parameter(); + parameter_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_parameter(); } inline const ::std::string &OpDesc_Var::parameter() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Var.parameter) - return parameter_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Var.parameter) + return parameter_.GetNoArena(); } inline void OpDesc_Var::set_parameter(const ::std::string &value) { - set_has_parameter(); - parameter_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Var.parameter) + set_has_parameter(); + parameter_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Var.parameter) } #if LANG_CXX11 inline void OpDesc_Var::set_parameter(::std::string &&value) { - set_has_parameter(); - parameter_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpDesc.Var.parameter) + set_has_parameter(); + parameter_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpDesc.Var.parameter) } #endif inline void OpDesc_Var::set_parameter(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_parameter(); - parameter_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Var.parameter) + GOOGLE_DCHECK(value != NULL); + set_has_parameter(); + parameter_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Var.parameter) } inline void OpDesc_Var::set_parameter(const char *value, size_t size) { - set_has_parameter(); - parameter_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Var.parameter) + set_has_parameter(); + parameter_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Var.parameter) } inline ::std::string *OpDesc_Var::mutable_parameter() { - set_has_parameter(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Var.parameter) - return parameter_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_parameter(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Var.parameter) + return parameter_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline ::std::string *OpDesc_Var::release_parameter() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpDesc.Var.parameter) - clear_has_parameter(); - return parameter_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpDesc.Var.parameter) + clear_has_parameter(); + return parameter_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void OpDesc_Var::set_allocated_parameter(::std::string *parameter) { - if (parameter != NULL) { - set_has_parameter(); - } else { - clear_has_parameter(); - } - parameter_.SetAllocatedNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - parameter); - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpDesc.Var.parameter) + if (parameter != NULL) { + set_has_parameter(); + } else { + clear_has_parameter(); + } + parameter_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), parameter); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpDesc.Var.parameter) } // repeated string arguments = 2; inline int OpDesc_Var::arguments_size() const { return arguments_.size(); } inline void OpDesc_Var::clear_arguments() { arguments_.Clear(); } inline const ::std::string &OpDesc_Var::arguments(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Var.arguments) - return arguments_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.Var.arguments) + return arguments_.Get(index); } inline ::std::string *OpDesc_Var::mutable_arguments(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Var.arguments) - return arguments_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.Var.arguments) + return arguments_.Mutable(index); } inline void OpDesc_Var::set_arguments(int index, const ::std::string &value) { - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Var.arguments) - arguments_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Var.arguments) + arguments_.Mutable(index)->assign(value); } #if LANG_CXX11 inline void OpDesc_Var::set_arguments(int index, ::std::string &&value) { - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Var.arguments) - arguments_.Mutable(index)->assign(std::move(value)); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.Var.arguments) + arguments_.Mutable(index)->assign(std::move(value)); } #endif inline void OpDesc_Var::set_arguments(int index, const char *value) { - GOOGLE_DCHECK(value != NULL); - arguments_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Var.arguments) + GOOGLE_DCHECK(value != NULL); + arguments_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.Var.arguments) } inline void OpDesc_Var::set_arguments(int index, const char *value, size_t size) { - arguments_.Mutable(index)->assign(reinterpret_cast(value), - size); - // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Var.arguments) + arguments_.Mutable(index)->assign(reinterpret_cast(value), + size); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.Var.arguments) } inline ::std::string *OpDesc_Var::add_arguments() { - // @@protoc_insertion_point(field_add_mutable:paddle_mobile.framework.proto.OpDesc.Var.arguments) - return arguments_.Add(); + // @@protoc_insertion_point(field_add_mutable:paddle_mobile.framework.proto.OpDesc.Var.arguments) + return arguments_.Add(); } inline void OpDesc_Var::add_arguments(const ::std::string &value) { - arguments_.Add()->assign(value); - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Var.arguments) + arguments_.Add()->assign(value); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Var.arguments) } #if LANG_CXX11 inline void OpDesc_Var::add_arguments(::std::string &&value) { - arguments_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Var.arguments) + arguments_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.Var.arguments) } #endif inline void OpDesc_Var::add_arguments(const char *value) { - GOOGLE_DCHECK(value != NULL); - arguments_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:paddle_mobile.framework.proto.OpDesc.Var.arguments) + GOOGLE_DCHECK(value != NULL); + arguments_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:paddle_mobile.framework.proto.OpDesc.Var.arguments) } inline void OpDesc_Var::add_arguments(const char *value, size_t size) { - arguments_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:paddle_mobile.framework.proto.OpDesc.Var.arguments) + arguments_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:paddle_mobile.framework.proto.OpDesc.Var.arguments) } inline const ::google::protobuf::RepeatedPtrField<::std::string> & OpDesc_Var::arguments() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Var.arguments) - return arguments_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.Var.arguments) + return arguments_; } inline ::google::protobuf::RepeatedPtrField<::std::string> * OpDesc_Var::mutable_arguments() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Var.arguments) - return &arguments_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.Var.arguments) + return &arguments_; } // ------------------------------------------------------------------- @@ -3224,70 +3197,67 @@ OpDesc_Var::mutable_arguments() { // required string type = 3; inline bool OpDesc::has_type() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } inline void OpDesc::set_has_type() { _has_bits_[0] |= 0x00000001u; } inline void OpDesc::clear_has_type() { _has_bits_[0] &= ~0x00000001u; } inline void OpDesc::clear_type() { - type_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_type(); + type_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_type(); } inline const ::std::string &OpDesc::type() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.type) - return type_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.type) + return type_.GetNoArena(); } inline void OpDesc::set_type(const ::std::string &value) { - set_has_type(); - type_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.type) + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.type) } #if LANG_CXX11 inline void OpDesc::set_type(::std::string &&value) { - set_has_type(); - type_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpDesc.type) + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpDesc.type) } #endif inline void OpDesc::set_type(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_type(); - type_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.type) + GOOGLE_DCHECK(value != NULL); + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpDesc.type) } inline void OpDesc::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:paddle_mobile.framework.proto.OpDesc.type) + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpDesc.type) } inline ::std::string *OpDesc::mutable_type() { - set_has_type(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.type) - return type_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_type(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.type) + return type_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline ::std::string *OpDesc::release_type() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpDesc.type) - clear_has_type(); - return type_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpDesc.type) + clear_has_type(); + return type_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void OpDesc::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:paddle_mobile.framework.proto.OpDesc.type) + if (type != NULL) { + set_has_type(); + } else { + clear_has_type(); + } + type_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), type); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpDesc.type) } // repeated .paddle_mobile.framework.proto.OpDesc.Var inputs = 1; @@ -3295,29 +3265,29 @@ inline int OpDesc::inputs_size() const { return inputs_.size(); } inline void OpDesc::clear_inputs() { inputs_.Clear(); } inline const ::paddle_mobile::framework::proto::OpDesc_Var & OpDesc::inputs(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.inputs) - return inputs_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.inputs) + return inputs_.Get(index); } inline ::paddle_mobile::framework::proto::OpDesc_Var * OpDesc::mutable_inputs(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.inputs) - return inputs_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.inputs) + return inputs_.Mutable(index); } inline ::paddle_mobile::framework::proto::OpDesc_Var *OpDesc::add_inputs() { - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.inputs) - return inputs_.Add(); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.inputs) + return inputs_.Add(); } inline ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpDesc_Var> * OpDesc::mutable_inputs() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.inputs) - return &inputs_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.inputs) + return &inputs_; } inline const ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpDesc_Var> & OpDesc::inputs() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.inputs) - return inputs_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.inputs) + return inputs_; } // repeated .paddle_mobile.framework.proto.OpDesc.Var outputs = 2; @@ -3325,29 +3295,29 @@ inline int OpDesc::outputs_size() const { return outputs_.size(); } inline void OpDesc::clear_outputs() { outputs_.Clear(); } inline const ::paddle_mobile::framework::proto::OpDesc_Var & OpDesc::outputs(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.outputs) - return outputs_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.outputs) + return outputs_.Get(index); } inline ::paddle_mobile::framework::proto::OpDesc_Var * OpDesc::mutable_outputs(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.outputs) - return outputs_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.outputs) + return outputs_.Mutable(index); } inline ::paddle_mobile::framework::proto::OpDesc_Var *OpDesc::add_outputs() { - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.outputs) - return outputs_.Add(); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.outputs) + return outputs_.Add(); } inline ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpDesc_Var> * OpDesc::mutable_outputs() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.outputs) - return &outputs_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.outputs) + return &outputs_; } inline const ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpDesc_Var> & OpDesc::outputs() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.outputs) - return outputs_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.outputs) + return outputs_; } // repeated .paddle_mobile.framework.proto.OpDesc.Attr attrs = 4; @@ -3355,49 +3325,49 @@ inline int OpDesc::attrs_size() const { return attrs_.size(); } inline void OpDesc::clear_attrs() { attrs_.Clear(); } inline const ::paddle_mobile::framework::proto::OpDesc_Attr & OpDesc::attrs(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.attrs) - return attrs_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.attrs) + return attrs_.Get(index); } inline ::paddle_mobile::framework::proto::OpDesc_Attr * OpDesc::mutable_attrs(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.attrs) - return attrs_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpDesc.attrs) + return attrs_.Mutable(index); } inline ::paddle_mobile::framework::proto::OpDesc_Attr *OpDesc::add_attrs() { - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.attrs) - return attrs_.Add(); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpDesc.attrs) + return attrs_.Add(); } inline ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpDesc_Attr> * OpDesc::mutable_attrs() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.attrs) - return &attrs_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpDesc.attrs) + return &attrs_; } inline const ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpDesc_Attr> & OpDesc::attrs() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.attrs) - return attrs_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpDesc.attrs) + return attrs_; } // optional bool is_target = 5 [default = false]; inline bool OpDesc::has_is_target() const { - return (_has_bits_[0] & 0x00000002u) != 0; + return (_has_bits_[0] & 0x00000002u) != 0; } inline void OpDesc::set_has_is_target() { _has_bits_[0] |= 0x00000002u; } inline void OpDesc::clear_has_is_target() { _has_bits_[0] &= ~0x00000002u; } inline void OpDesc::clear_is_target() { - is_target_ = false; - clear_has_is_target(); + is_target_ = false; + clear_has_is_target(); } inline bool OpDesc::is_target() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.is_target) - return is_target_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpDesc.is_target) + return is_target_; } inline void OpDesc::set_is_target(bool value) { - set_has_is_target(); - is_target_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.is_target) + set_has_is_target(); + is_target_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpDesc.is_target) } // ------------------------------------------------------------------- @@ -3406,206 +3376,203 @@ inline void OpDesc::set_is_target(bool value) { // required string name = 1; inline bool OpProto_Var::has_name() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } inline void OpProto_Var::set_has_name() { _has_bits_[0] |= 0x00000001u; } inline void OpProto_Var::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void OpProto_Var::clear_name() { - name_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_name(); + name_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); } inline const ::std::string &OpProto_Var::name() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.name) - return name_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.name) + return name_.GetNoArena(); } inline void OpProto_Var::set_name(const ::std::string &value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.name) } #if LANG_CXX11 inline void OpProto_Var::set_name(::std::string &&value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.Var.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.Var.name) } #endif inline void OpProto_Var::set_name(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.Var.name) + GOOGLE_DCHECK(value != NULL); + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.Var.name) } inline void OpProto_Var::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:paddle_mobile.framework.proto.OpProto.Var.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.Var.name) } inline ::std::string *OpProto_Var::mutable_name() { - set_has_name(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.Var.name) - return name_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_name(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.Var.name) + return name_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline ::std::string *OpProto_Var::release_name() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.Var.name) - clear_has_name(); - return name_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.Var.name) + clear_has_name(); + return name_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void OpProto_Var::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:paddle_mobile.framework.proto.OpProto.Var.name) + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpProto.Var.name) } // required string comment = 2; inline bool OpProto_Var::has_comment() const { - return (_has_bits_[0] & 0x00000002u) != 0; + return (_has_bits_[0] & 0x00000002u) != 0; } inline void OpProto_Var::set_has_comment() { _has_bits_[0] |= 0x00000002u; } inline void OpProto_Var::clear_has_comment() { _has_bits_[0] &= ~0x00000002u; } inline void OpProto_Var::clear_comment() { - comment_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_comment(); + comment_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_comment(); } inline const ::std::string &OpProto_Var::comment() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.comment) - return comment_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.comment) + return comment_.GetNoArena(); } inline void OpProto_Var::set_comment(const ::std::string &value) { - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.comment) + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.comment) } #if LANG_CXX11 inline void OpProto_Var::set_comment(::std::string &&value) { - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.Var.comment) + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.Var.comment) } #endif inline void OpProto_Var::set_comment(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.Var.comment) + GOOGLE_DCHECK(value != NULL); + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.Var.comment) } inline void OpProto_Var::set_comment(const char *value, size_t size) { - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.Var.comment) + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.Var.comment) } inline ::std::string *OpProto_Var::mutable_comment() { - set_has_comment(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.Var.comment) - return comment_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_comment(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.Var.comment) + return comment_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline ::std::string *OpProto_Var::release_comment() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.Var.comment) - clear_has_comment(); - return comment_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.Var.comment) + clear_has_comment(); + return comment_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void OpProto_Var::set_allocated_comment(::std::string *comment) { - if (comment != NULL) { - set_has_comment(); - } else { - clear_has_comment(); - } - comment_.SetAllocatedNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), comment); - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpProto.Var.comment) + if (comment != NULL) { + set_has_comment(); + } else { + clear_has_comment(); + } + comment_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), comment); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpProto.Var.comment) } // optional bool duplicable = 3 [default = false]; inline bool OpProto_Var::has_duplicable() const { - return (_has_bits_[0] & 0x00000004u) != 0; + return (_has_bits_[0] & 0x00000004u) != 0; } inline void OpProto_Var::set_has_duplicable() { _has_bits_[0] |= 0x00000004u; } inline void OpProto_Var::clear_has_duplicable() { - _has_bits_[0] &= ~0x00000004u; + _has_bits_[0] &= ~0x00000004u; } inline void OpProto_Var::clear_duplicable() { - duplicable_ = false; - clear_has_duplicable(); + duplicable_ = false; + clear_has_duplicable(); } inline bool OpProto_Var::duplicable() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.duplicable) - return duplicable_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.duplicable) + return duplicable_; } inline void OpProto_Var::set_duplicable(bool value) { - set_has_duplicable(); - duplicable_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.duplicable) + set_has_duplicable(); + duplicable_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.duplicable) } // optional bool intermediate = 4 [default = false]; inline bool OpProto_Var::has_intermediate() const { - return (_has_bits_[0] & 0x00000008u) != 0; + return (_has_bits_[0] & 0x00000008u) != 0; } inline void OpProto_Var::set_has_intermediate() { - _has_bits_[0] |= 0x00000008u; + _has_bits_[0] |= 0x00000008u; } inline void OpProto_Var::clear_has_intermediate() { - _has_bits_[0] &= ~0x00000008u; + _has_bits_[0] &= ~0x00000008u; } inline void OpProto_Var::clear_intermediate() { - intermediate_ = false; - clear_has_intermediate(); + intermediate_ = false; + clear_has_intermediate(); } inline bool OpProto_Var::intermediate() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.intermediate) - return intermediate_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.intermediate) + return intermediate_; } inline void OpProto_Var::set_intermediate(bool value) { - set_has_intermediate(); - intermediate_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.intermediate) + set_has_intermediate(); + intermediate_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.intermediate) } // optional bool dispensable = 5 [default = false]; inline bool OpProto_Var::has_dispensable() const { - return (_has_bits_[0] & 0x00000010u) != 0; + return (_has_bits_[0] & 0x00000010u) != 0; } inline void OpProto_Var::set_has_dispensable() { _has_bits_[0] |= 0x00000010u; } inline void OpProto_Var::clear_has_dispensable() { - _has_bits_[0] &= ~0x00000010u; + _has_bits_[0] &= ~0x00000010u; } inline void OpProto_Var::clear_dispensable() { - dispensable_ = false; - clear_has_dispensable(); + dispensable_ = false; + clear_has_dispensable(); } inline bool OpProto_Var::dispensable() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.dispensable) - return dispensable_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Var.dispensable) + return dispensable_; } inline void OpProto_Var::set_dispensable(bool value) { - set_has_dispensable(); - dispensable_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.dispensable) + set_has_dispensable(); + dispensable_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Var.dispensable) } // ------------------------------------------------------------------- @@ -3614,182 +3581,179 @@ inline void OpProto_Var::set_dispensable(bool value) { // required string name = 1; inline bool OpProto_Attr::has_name() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } inline void OpProto_Attr::set_has_name() { _has_bits_[0] |= 0x00000001u; } inline void OpProto_Attr::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void OpProto_Attr::clear_name() { - name_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_name(); + name_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); } inline const ::std::string &OpProto_Attr::name() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Attr.name) - return name_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Attr.name) + return name_.GetNoArena(); } inline void OpProto_Attr::set_name(const ::std::string &value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Attr.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Attr.name) } #if LANG_CXX11 inline void OpProto_Attr::set_name(::std::string &&value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.Attr.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.Attr.name) } #endif inline void OpProto_Attr::set_name(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.Attr.name) + GOOGLE_DCHECK(value != NULL); + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.Attr.name) } inline void OpProto_Attr::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:paddle_mobile.framework.proto.OpProto.Attr.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.Attr.name) } inline ::std::string *OpProto_Attr::mutable_name() { - set_has_name(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.Attr.name) - return name_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_name(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.Attr.name) + return name_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline ::std::string *OpProto_Attr::release_name() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.Attr.name) - clear_has_name(); - return name_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.Attr.name) + clear_has_name(); + return name_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void OpProto_Attr::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:paddle_mobile.framework.proto.OpProto.Attr.name) + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpProto.Attr.name) } // required .paddle_mobile.framework.proto.AttrType type = 2; inline bool OpProto_Attr::has_type() const { - return (_has_bits_[0] & 0x00000004u) != 0; + return (_has_bits_[0] & 0x00000004u) != 0; } inline void OpProto_Attr::set_has_type() { _has_bits_[0] |= 0x00000004u; } inline void OpProto_Attr::clear_has_type() { _has_bits_[0] &= ~0x00000004u; } inline void OpProto_Attr::clear_type() { - type_ = 0; - clear_has_type(); + type_ = 0; + clear_has_type(); } inline ::paddle_mobile::framework::proto::AttrType OpProto_Attr::type() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Attr.type) - return static_cast<::paddle_mobile::framework::proto::AttrType>(type_); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Attr.type) + return static_cast<::paddle_mobile::framework::proto::AttrType>(type_); } inline void OpProto_Attr::set_type(::paddle_mobile::framework::proto::AttrType value) { - assert(::paddle_mobile::framework::proto::AttrType_IsValid(value)); - set_has_type(); - type_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Attr.type) + assert(::paddle_mobile::framework::proto::AttrType_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Attr.type) } // required string comment = 3; inline bool OpProto_Attr::has_comment() const { - return (_has_bits_[0] & 0x00000002u) != 0; + return (_has_bits_[0] & 0x00000002u) != 0; } inline void OpProto_Attr::set_has_comment() { _has_bits_[0] |= 0x00000002u; } inline void OpProto_Attr::clear_has_comment() { _has_bits_[0] &= ~0x00000002u; } inline void OpProto_Attr::clear_comment() { - comment_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_comment(); + comment_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_comment(); } inline const ::std::string &OpProto_Attr::comment() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Attr.comment) - return comment_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Attr.comment) + return comment_.GetNoArena(); } inline void OpProto_Attr::set_comment(const ::std::string &value) { - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Attr.comment) + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Attr.comment) } #if LANG_CXX11 inline void OpProto_Attr::set_comment(::std::string &&value) { - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.Attr.comment) + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.Attr.comment) } #endif inline void OpProto_Attr::set_comment(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.Attr.comment) + GOOGLE_DCHECK(value != NULL); + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.Attr.comment) } inline void OpProto_Attr::set_comment(const char *value, size_t size) { - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.Attr.comment) + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.Attr.comment) } inline ::std::string *OpProto_Attr::mutable_comment() { - set_has_comment(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.Attr.comment) - return comment_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_comment(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.Attr.comment) + return comment_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline ::std::string *OpProto_Attr::release_comment() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.Attr.comment) - clear_has_comment(); - return comment_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.Attr.comment) + clear_has_comment(); + return comment_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void OpProto_Attr::set_allocated_comment(::std::string *comment) { - if (comment != NULL) { - set_has_comment(); - } else { - clear_has_comment(); - } - comment_.SetAllocatedNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), comment); - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpProto.Attr.comment) + if (comment != NULL) { + set_has_comment(); + } else { + clear_has_comment(); + } + comment_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), comment); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpProto.Attr.comment) } // optional bool generated = 4 [default = false]; inline bool OpProto_Attr::has_generated() const { - return (_has_bits_[0] & 0x00000008u) != 0; + return (_has_bits_[0] & 0x00000008u) != 0; } inline void OpProto_Attr::set_has_generated() { _has_bits_[0] |= 0x00000008u; } inline void OpProto_Attr::clear_has_generated() { - _has_bits_[0] &= ~0x00000008u; + _has_bits_[0] &= ~0x00000008u; } inline void OpProto_Attr::clear_generated() { - generated_ = false; - clear_has_generated(); + generated_ = false; + clear_has_generated(); } inline bool OpProto_Attr::generated() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Attr.generated) - return generated_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.Attr.generated) + return generated_; } inline void OpProto_Attr::set_generated(bool value) { - set_has_generated(); - generated_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Attr.generated) + set_has_generated(); + generated_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.Attr.generated) } // ------------------------------------------------------------------- @@ -3798,70 +3762,67 @@ inline void OpProto_Attr::set_generated(bool value) { // required string type = 1; inline bool OpProto::has_type() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } inline void OpProto::set_has_type() { _has_bits_[0] |= 0x00000001u; } inline void OpProto::clear_has_type() { _has_bits_[0] &= ~0x00000001u; } inline void OpProto::clear_type() { - type_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_type(); + type_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_type(); } inline const ::std::string &OpProto::type() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.type) - return type_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.type) + return type_.GetNoArena(); } inline void OpProto::set_type(const ::std::string &value) { - set_has_type(); - type_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.type) + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.type) } #if LANG_CXX11 inline void OpProto::set_type(::std::string &&value) { - set_has_type(); - type_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.type) + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.type) } #endif inline void OpProto::set_type(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_type(); - type_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.type) + GOOGLE_DCHECK(value != NULL); + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.type) } inline void OpProto::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:paddle_mobile.framework.proto.OpProto.type) + set_has_type(); + type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.type) } inline ::std::string *OpProto::mutable_type() { - set_has_type(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.type) - return type_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_type(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.type) + return type_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline ::std::string *OpProto::release_type() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.type) - clear_has_type(); - return type_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.type) + clear_has_type(); + return type_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void OpProto::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:paddle_mobile.framework.proto.OpProto.type) + if (type != NULL) { + set_has_type(); + } else { + clear_has_type(); + } + type_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), type); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpProto.type) } // repeated .paddle_mobile.framework.proto.OpProto.Var inputs = 2; @@ -3869,29 +3830,29 @@ inline int OpProto::inputs_size() const { return inputs_.size(); } inline void OpProto::clear_inputs() { inputs_.Clear(); } inline const ::paddle_mobile::framework::proto::OpProto_Var & OpProto::inputs(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.inputs) - return inputs_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.inputs) + return inputs_.Get(index); } inline ::paddle_mobile::framework::proto::OpProto_Var * OpProto::mutable_inputs(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.inputs) - return inputs_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.inputs) + return inputs_.Mutable(index); } inline ::paddle_mobile::framework::proto::OpProto_Var *OpProto::add_inputs() { - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpProto.inputs) - return inputs_.Add(); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpProto.inputs) + return inputs_.Add(); } inline ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpProto_Var> * OpProto::mutable_inputs() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.inputs) - return &inputs_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.inputs) + return &inputs_; } inline const ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpProto_Var> & OpProto::inputs() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.inputs) - return inputs_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.inputs) + return inputs_; } // repeated .paddle_mobile.framework.proto.OpProto.Var outputs = 3; @@ -3899,29 +3860,29 @@ inline int OpProto::outputs_size() const { return outputs_.size(); } inline void OpProto::clear_outputs() { outputs_.Clear(); } inline const ::paddle_mobile::framework::proto::OpProto_Var & OpProto::outputs(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.outputs) - return outputs_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.outputs) + return outputs_.Get(index); } inline ::paddle_mobile::framework::proto::OpProto_Var * OpProto::mutable_outputs(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.outputs) - return outputs_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.outputs) + return outputs_.Mutable(index); } inline ::paddle_mobile::framework::proto::OpProto_Var *OpProto::add_outputs() { - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpProto.outputs) - return outputs_.Add(); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpProto.outputs) + return outputs_.Add(); } inline ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpProto_Var> * OpProto::mutable_outputs() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.outputs) - return &outputs_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.outputs) + return &outputs_; } inline const ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpProto_Var> & OpProto::outputs() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.outputs) - return outputs_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.outputs) + return outputs_; } // repeated .paddle_mobile.framework.proto.OpProto.Attr attrs = 4; @@ -3929,97 +3890,97 @@ inline int OpProto::attrs_size() const { return attrs_.size(); } inline void OpProto::clear_attrs() { attrs_.Clear(); } inline const ::paddle_mobile::framework::proto::OpProto_Attr & OpProto::attrs(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.attrs) - return attrs_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.attrs) + return attrs_.Get(index); } inline ::paddle_mobile::framework::proto::OpProto_Attr * OpProto::mutable_attrs(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.attrs) - return attrs_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.attrs) + return attrs_.Mutable(index); } inline ::paddle_mobile::framework::proto::OpProto_Attr *OpProto::add_attrs() { - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpProto.attrs) - return attrs_.Add(); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.OpProto.attrs) + return attrs_.Add(); } inline ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpProto_Attr> * OpProto::mutable_attrs() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.attrs) - return &attrs_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.OpProto.attrs) + return &attrs_; } inline const ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpProto_Attr> & OpProto::attrs() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.attrs) - return attrs_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.OpProto.attrs) + return attrs_; } // required string comment = 5; inline bool OpProto::has_comment() const { - return (_has_bits_[0] & 0x00000002u) != 0; + return (_has_bits_[0] & 0x00000002u) != 0; } inline void OpProto::set_has_comment() { _has_bits_[0] |= 0x00000002u; } inline void OpProto::clear_has_comment() { _has_bits_[0] &= ~0x00000002u; } inline void OpProto::clear_comment() { - comment_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_comment(); + comment_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_comment(); } inline const ::std::string &OpProto::comment() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.comment) - return comment_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.OpProto.comment) + return comment_.GetNoArena(); } inline void OpProto::set_comment(const ::std::string &value) { - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.comment) + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.OpProto.comment) } #if LANG_CXX11 inline void OpProto::set_comment(::std::string &&value) { - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.comment) + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.OpProto.comment) } #endif inline void OpProto::set_comment(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.comment) + GOOGLE_DCHECK(value != NULL); + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.OpProto.comment) } inline void OpProto::set_comment(const char *value, size_t size) { - set_has_comment(); - comment_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(reinterpret_cast(value), size)); - // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.comment) + set_has_comment(); + comment_.SetNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.OpProto.comment) } inline ::std::string *OpProto::mutable_comment() { - set_has_comment(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.comment) - return comment_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_comment(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.OpProto.comment) + return comment_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline ::std::string *OpProto::release_comment() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.comment) - clear_has_comment(); - return comment_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.OpProto.comment) + clear_has_comment(); + return comment_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void OpProto::set_allocated_comment(::std::string *comment) { - if (comment != NULL) { - set_has_comment(); - } else { - clear_has_comment(); - } - comment_.SetAllocatedNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), comment); - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpProto.comment) + if (comment != NULL) { + set_has_comment(); + } else { + clear_has_comment(); + } + comment_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), comment); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.OpProto.comment) } // ------------------------------------------------------------------- @@ -4029,57 +3990,57 @@ inline void OpProto::set_allocated_comment(::std::string *comment) { // required .paddle_mobile.framework.proto.VarType.Type data_type = // 1; inline bool VarType_TensorDesc::has_data_type() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } inline void VarType_TensorDesc::set_has_data_type() { - _has_bits_[0] |= 0x00000001u; + _has_bits_[0] |= 0x00000001u; } inline void VarType_TensorDesc::clear_has_data_type() { - _has_bits_[0] &= ~0x00000001u; + _has_bits_[0] &= ~0x00000001u; } inline void VarType_TensorDesc::clear_data_type() { - data_type_ = 0; - clear_has_data_type(); + data_type_ = 0; + clear_has_data_type(); } inline ::paddle_mobile::framework::proto::VarType_Type VarType_TensorDesc::data_type() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.TensorDesc.data_type) - return static_cast<::paddle_mobile::framework::proto::VarType_Type>( - data_type_); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.TensorDesc.data_type) + return static_cast<::paddle_mobile::framework::proto::VarType_Type>( + data_type_); } inline void VarType_TensorDesc::set_data_type( ::paddle_mobile::framework::proto::VarType_Type value) { - assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); - set_has_data_type(); - data_type_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.TensorDesc.data_type) + assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); + set_has_data_type(); + data_type_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.TensorDesc.data_type) } // repeated int64 dims = 2; inline int VarType_TensorDesc::dims_size() const { return dims_.size(); } inline void VarType_TensorDesc::clear_dims() { dims_.Clear(); } inline ::google::protobuf::int64 VarType_TensorDesc::dims(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.TensorDesc.dims) - return dims_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.TensorDesc.dims) + return dims_.Get(index); } inline void VarType_TensorDesc::set_dims(int index, ::google::protobuf::int64 value) { - dims_.Set(index, value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.TensorDesc.dims) + dims_.Set(index, value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.TensorDesc.dims) } inline void VarType_TensorDesc::add_dims(::google::protobuf::int64 value) { - dims_.Add(value); - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.VarType.TensorDesc.dims) + dims_.Add(value); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.VarType.TensorDesc.dims) } inline const ::google::protobuf::RepeatedField<::google::protobuf::int64> & VarType_TensorDesc::dims() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.TensorDesc.dims) - return dims_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.TensorDesc.dims) + return dims_; } inline ::google::protobuf::RepeatedField<::google::protobuf::int64> * VarType_TensorDesc::mutable_dims() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.VarType.TensorDesc.dims) - return &dims_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.VarType.TensorDesc.dims) + return &dims_; } // ------------------------------------------------------------------- @@ -4089,82 +4050,82 @@ VarType_TensorDesc::mutable_dims() { // required .paddle_mobile.framework.proto.VarType.TensorDesc tensor // = 1; inline bool VarType_LoDTensorDesc::has_tensor() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } inline void VarType_LoDTensorDesc::set_has_tensor() { - _has_bits_[0] |= 0x00000001u; + _has_bits_[0] |= 0x00000001u; } inline void VarType_LoDTensorDesc::clear_has_tensor() { - _has_bits_[0] &= ~0x00000001u; + _has_bits_[0] &= ~0x00000001u; } inline void VarType_LoDTensorDesc::clear_tensor() { - if (tensor_ != NULL) - tensor_->::paddle_mobile::framework::proto::VarType_TensorDesc::Clear(); - clear_has_tensor(); + if (tensor_ != NULL) + tensor_->::paddle_mobile::framework::proto::VarType_TensorDesc::Clear(); + clear_has_tensor(); } inline const ::paddle_mobile::framework::proto::VarType_TensorDesc & VarType_LoDTensorDesc::tensor() const { - const ::paddle_mobile::framework::proto::VarType_TensorDesc *p = tensor_; - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorDesc.tensor) - return p != NULL - ? *p - : *reinterpret_cast< - const ::paddle_mobile::framework::proto::VarType_TensorDesc - *>(&::paddle_mobile::framework::proto:: - _VarType_TensorDesc_default_instance_); + const ::paddle_mobile::framework::proto::VarType_TensorDesc *p = tensor_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorDesc.tensor) + return p != NULL + ? *p + : *reinterpret_cast< + const ::paddle_mobile::framework::proto::VarType_TensorDesc + *>(&::paddle_mobile::framework::proto:: + _VarType_TensorDesc_default_instance_); } inline ::paddle_mobile::framework::proto::VarType_TensorDesc * VarType_LoDTensorDesc::mutable_tensor() { - set_has_tensor(); - if (tensor_ == NULL) { - tensor_ = new ::paddle_mobile::framework::proto::VarType_TensorDesc; - } - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.LoDTensorDesc.tensor) - return tensor_; + set_has_tensor(); + if (tensor_ == NULL) { + tensor_ = new ::paddle_mobile::framework::proto::VarType_TensorDesc; + } + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.LoDTensorDesc.tensor) + return tensor_; } inline ::paddle_mobile::framework::proto::VarType_TensorDesc * VarType_LoDTensorDesc::release_tensor() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.LoDTensorDesc.tensor) - clear_has_tensor(); - ::paddle_mobile::framework::proto::VarType_TensorDesc *temp = tensor_; - tensor_ = NULL; - return temp; + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.LoDTensorDesc.tensor) + clear_has_tensor(); + ::paddle_mobile::framework::proto::VarType_TensorDesc *temp = tensor_; + tensor_ = NULL; + return temp; } inline void VarType_LoDTensorDesc::set_allocated_tensor( ::paddle_mobile::framework::proto::VarType_TensorDesc *tensor) { - delete tensor_; - tensor_ = tensor; - if (tensor) { - set_has_tensor(); - } else { - clear_has_tensor(); - } - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.LoDTensorDesc.tensor) + delete tensor_; + tensor_ = tensor; + if (tensor) { + set_has_tensor(); + } else { + clear_has_tensor(); + } + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.LoDTensorDesc.tensor) } // optional int32 lod_level = 2 [default = 0]; inline bool VarType_LoDTensorDesc::has_lod_level() const { - return (_has_bits_[0] & 0x00000002u) != 0; + return (_has_bits_[0] & 0x00000002u) != 0; } inline void VarType_LoDTensorDesc::set_has_lod_level() { - _has_bits_[0] |= 0x00000002u; + _has_bits_[0] |= 0x00000002u; } inline void VarType_LoDTensorDesc::clear_has_lod_level() { - _has_bits_[0] &= ~0x00000002u; + _has_bits_[0] &= ~0x00000002u; } inline void VarType_LoDTensorDesc::clear_lod_level() { - lod_level_ = 0; - clear_has_lod_level(); + lod_level_ = 0; + clear_has_lod_level(); } inline ::google::protobuf::int32 VarType_LoDTensorDesc::lod_level() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorDesc.lod_level) - return lod_level_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorDesc.lod_level) + return lod_level_; } inline void VarType_LoDTensorDesc::set_lod_level(::google::protobuf::int32 value) { - set_has_lod_level(); - lod_level_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.LoDTensorDesc.lod_level) + set_has_lod_level(); + lod_level_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.LoDTensorDesc.lod_level) } // ------------------------------------------------------------------- @@ -4174,82 +4135,82 @@ VarType_LoDTensorDesc::set_lod_level(::google::protobuf::int32 value) { // required .paddle_mobile.framework.proto.VarType.TensorDesc tensor // = 1; inline bool VarType_LoDTensorArrayDesc::has_tensor() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } inline void VarType_LoDTensorArrayDesc::set_has_tensor() { - _has_bits_[0] |= 0x00000001u; + _has_bits_[0] |= 0x00000001u; } inline void VarType_LoDTensorArrayDesc::clear_has_tensor() { - _has_bits_[0] &= ~0x00000001u; + _has_bits_[0] &= ~0x00000001u; } inline void VarType_LoDTensorArrayDesc::clear_tensor() { - if (tensor_ != NULL) - tensor_->::paddle_mobile::framework::proto::VarType_TensorDesc::Clear(); - clear_has_tensor(); + if (tensor_ != NULL) + tensor_->::paddle_mobile::framework::proto::VarType_TensorDesc::Clear(); + clear_has_tensor(); } inline const ::paddle_mobile::framework::proto::VarType_TensorDesc & VarType_LoDTensorArrayDesc::tensor() const { - const ::paddle_mobile::framework::proto::VarType_TensorDesc *p = tensor_; - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.tensor) - return p != NULL - ? *p - : *reinterpret_cast< - const ::paddle_mobile::framework::proto::VarType_TensorDesc - *>(&::paddle_mobile::framework::proto:: - _VarType_TensorDesc_default_instance_); + const ::paddle_mobile::framework::proto::VarType_TensorDesc *p = tensor_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.tensor) + return p != NULL + ? *p + : *reinterpret_cast< + const ::paddle_mobile::framework::proto::VarType_TensorDesc + *>(&::paddle_mobile::framework::proto:: + _VarType_TensorDesc_default_instance_); } inline ::paddle_mobile::framework::proto::VarType_TensorDesc * VarType_LoDTensorArrayDesc::mutable_tensor() { - set_has_tensor(); - if (tensor_ == NULL) { - tensor_ = new ::paddle_mobile::framework::proto::VarType_TensorDesc; - } - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.tensor) - return tensor_; + set_has_tensor(); + if (tensor_ == NULL) { + tensor_ = new ::paddle_mobile::framework::proto::VarType_TensorDesc; + } + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.tensor) + return tensor_; } inline ::paddle_mobile::framework::proto::VarType_TensorDesc * VarType_LoDTensorArrayDesc::release_tensor() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.tensor) - clear_has_tensor(); - ::paddle_mobile::framework::proto::VarType_TensorDesc *temp = tensor_; - tensor_ = NULL; - return temp; + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.tensor) + clear_has_tensor(); + ::paddle_mobile::framework::proto::VarType_TensorDesc *temp = tensor_; + tensor_ = NULL; + return temp; } inline void VarType_LoDTensorArrayDesc::set_allocated_tensor( ::paddle_mobile::framework::proto::VarType_TensorDesc *tensor) { - delete tensor_; - tensor_ = tensor; - if (tensor) { - set_has_tensor(); - } else { - clear_has_tensor(); - } - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.tensor) + delete tensor_; + tensor_ = tensor; + if (tensor) { + set_has_tensor(); + } else { + clear_has_tensor(); + } + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.tensor) } // optional int32 lod_level = 2 [default = 0]; inline bool VarType_LoDTensorArrayDesc::has_lod_level() const { - return (_has_bits_[0] & 0x00000002u) != 0; + return (_has_bits_[0] & 0x00000002u) != 0; } inline void VarType_LoDTensorArrayDesc::set_has_lod_level() { - _has_bits_[0] |= 0x00000002u; + _has_bits_[0] |= 0x00000002u; } inline void VarType_LoDTensorArrayDesc::clear_has_lod_level() { - _has_bits_[0] &= ~0x00000002u; + _has_bits_[0] &= ~0x00000002u; } inline void VarType_LoDTensorArrayDesc::clear_lod_level() { - lod_level_ = 0; - clear_has_lod_level(); + lod_level_ = 0; + clear_has_lod_level(); } inline ::google::protobuf::int32 VarType_LoDTensorArrayDesc::lod_level() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.lod_level) - return lod_level_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.lod_level) + return lod_level_; } inline void VarType_LoDTensorArrayDesc::set_lod_level(::google::protobuf::int32 value) { - set_has_lod_level(); - lod_level_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.lod_level) + set_has_lod_level(); + lod_level_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc.lod_level) } // ------------------------------------------------------------------- @@ -4259,35 +4220,35 @@ VarType_LoDTensorArrayDesc::set_lod_level(::google::protobuf::int32 value) { // repeated .paddle_mobile.framework.proto.VarType.LoDTensorDesc // lod_tensor = 1; inline int VarType_ReaderDesc::lod_tensor_size() const { - return lod_tensor_.size(); + return lod_tensor_.size(); } inline void VarType_ReaderDesc::clear_lod_tensor() { lod_tensor_.Clear(); } inline const ::paddle_mobile::framework::proto::VarType_LoDTensorDesc & VarType_ReaderDesc::lod_tensor(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) - return lod_tensor_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) + return lod_tensor_.Get(index); } inline ::paddle_mobile::framework::proto::VarType_LoDTensorDesc * VarType_ReaderDesc::mutable_lod_tensor(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) - return lod_tensor_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) + return lod_tensor_.Mutable(index); } inline ::paddle_mobile::framework::proto::VarType_LoDTensorDesc * VarType_ReaderDesc::add_lod_tensor() { - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) - return lod_tensor_.Add(); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) + return lod_tensor_.Add(); } inline ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> * VarType_ReaderDesc::mutable_lod_tensor() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) - return &lod_tensor_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) + return &lod_tensor_; } inline const ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::VarType_LoDTensorDesc> & VarType_ReaderDesc::lod_tensor() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) - return lod_tensor_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.ReaderDesc.lod_tensor) + return lod_tensor_; } // ------------------------------------------------------------------- @@ -4297,54 +4258,54 @@ VarType_ReaderDesc::lod_tensor() const { // required .paddle_mobile.framework.proto.VarType.Type data_type = // 1; inline bool VarType_ChannelDesc::has_data_type() const { - return (_has_bits_[0] & 0x00000002u) != 0; + return (_has_bits_[0] & 0x00000002u) != 0; } inline void VarType_ChannelDesc::set_has_data_type() { - _has_bits_[0] |= 0x00000002u; + _has_bits_[0] |= 0x00000002u; } inline void VarType_ChannelDesc::clear_has_data_type() { - _has_bits_[0] &= ~0x00000002u; + _has_bits_[0] &= ~0x00000002u; } inline void VarType_ChannelDesc::clear_data_type() { - data_type_ = 0; - clear_has_data_type(); + data_type_ = 0; + clear_has_data_type(); } inline ::paddle_mobile::framework::proto::VarType_Type VarType_ChannelDesc::data_type() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.ChannelDesc.data_type) - return static_cast<::paddle_mobile::framework::proto::VarType_Type>( - data_type_); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.ChannelDesc.data_type) + return static_cast<::paddle_mobile::framework::proto::VarType_Type>( + data_type_); } inline void VarType_ChannelDesc::set_data_type( ::paddle_mobile::framework::proto::VarType_Type value) { - assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); - set_has_data_type(); - data_type_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.ChannelDesc.data_type) + assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); + set_has_data_type(); + data_type_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.ChannelDesc.data_type) } // required int64 capacity = 2; inline bool VarType_ChannelDesc::has_capacity() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } inline void VarType_ChannelDesc::set_has_capacity() { - _has_bits_[0] |= 0x00000001u; + _has_bits_[0] |= 0x00000001u; } inline void VarType_ChannelDesc::clear_has_capacity() { - _has_bits_[0] &= ~0x00000001u; + _has_bits_[0] &= ~0x00000001u; } inline void VarType_ChannelDesc::clear_capacity() { - capacity_ = GOOGLE_LONGLONG(0); - clear_has_capacity(); + capacity_ = GOOGLE_LONGLONG(0); + clear_has_capacity(); } inline ::google::protobuf::int64 VarType_ChannelDesc::capacity() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.ChannelDesc.capacity) - return capacity_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.ChannelDesc.capacity) + return capacity_; } inline void VarType_ChannelDesc::set_capacity(::google::protobuf::int64 value) { - set_has_capacity(); - capacity_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.ChannelDesc.capacity) + set_has_capacity(); + capacity_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.ChannelDesc.capacity) } // ------------------------------------------------------------------- @@ -4354,36 +4315,36 @@ inline void VarType_ChannelDesc::set_capacity(::google::protobuf::int64 value) { // repeated .paddle_mobile.framework.proto.VarType.Type element_type // = 1; inline int VarType_Tuple::element_type_size() const { - return element_type_.size(); + return element_type_.size(); } inline void VarType_Tuple::clear_element_type() { element_type_.Clear(); } inline ::paddle_mobile::framework::proto::VarType_Type VarType_Tuple::element_type(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.Tuple.element_type) - return static_cast<::paddle_mobile::framework::proto::VarType_Type>( - element_type_.Get(index)); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.Tuple.element_type) + return static_cast<::paddle_mobile::framework::proto::VarType_Type>( + element_type_.Get(index)); } inline void VarType_Tuple::set_element_type( int index, ::paddle_mobile::framework::proto::VarType_Type value) { - assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); - element_type_.Set(index, value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.Tuple.element_type) + assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); + element_type_.Set(index, value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.Tuple.element_type) } inline void VarType_Tuple::add_element_type( ::paddle_mobile::framework::proto::VarType_Type value) { - assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); - element_type_.Add(value); - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.VarType.Tuple.element_type) + assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); + element_type_.Add(value); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.VarType.Tuple.element_type) } inline const ::google::protobuf::RepeatedField & VarType_Tuple::element_type() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.Tuple.element_type) - return element_type_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.VarType.Tuple.element_type) + return element_type_; } inline ::google::protobuf::RepeatedField * VarType_Tuple::mutable_element_type() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.VarType.Tuple.element_type) - return &element_type_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.VarType.Tuple.element_type) + return &element_type_; } // ------------------------------------------------------------------- @@ -4392,350 +4353,345 @@ VarType_Tuple::mutable_element_type() { // required .paddle_mobile.framework.proto.VarType.Type type = 1; inline bool VarType::has_type() const { - return (_has_bits_[0] & 0x00000040u) != 0; + return (_has_bits_[0] & 0x00000040u) != 0; } inline void VarType::set_has_type() { _has_bits_[0] |= 0x00000040u; } inline void VarType::clear_has_type() { _has_bits_[0] &= ~0x00000040u; } inline void VarType::clear_type() { - type_ = 0; - clear_has_type(); + type_ = 0; + clear_has_type(); } inline ::paddle_mobile::framework::proto::VarType_Type VarType::type() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.type) - return static_cast<::paddle_mobile::framework::proto::VarType_Type>(type_); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.type) + return static_cast<::paddle_mobile::framework::proto::VarType_Type>(type_); } inline void VarType::set_type(::paddle_mobile::framework::proto::VarType_Type value) { - assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); - set_has_type(); - type_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.type) + assert(::paddle_mobile::framework::proto::VarType_Type_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarType.type) } // optional .paddle_mobile.framework.proto.VarType.TensorDesc // selected_rows = 2; inline bool VarType::has_selected_rows() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } inline void VarType::set_has_selected_rows() { _has_bits_[0] |= 0x00000001u; } inline void VarType::clear_has_selected_rows() { - _has_bits_[0] &= ~0x00000001u; + _has_bits_[0] &= ~0x00000001u; } inline void VarType::clear_selected_rows() { - if (selected_rows_ != NULL) - selected_rows_ - ->::paddle_mobile::framework::proto::VarType_TensorDesc::Clear(); - clear_has_selected_rows(); + if (selected_rows_ != NULL) + selected_rows_ + ->::paddle_mobile::framework::proto::VarType_TensorDesc::Clear(); + clear_has_selected_rows(); } inline const ::paddle_mobile::framework::proto::VarType_TensorDesc & VarType::selected_rows() const { - const ::paddle_mobile::framework::proto::VarType_TensorDesc *p = - selected_rows_; - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.selected_rows) - return p != NULL - ? *p - : *reinterpret_cast< - const ::paddle_mobile::framework::proto::VarType_TensorDesc - *>(&::paddle_mobile::framework::proto:: - _VarType_TensorDesc_default_instance_); + const ::paddle_mobile::framework::proto::VarType_TensorDesc *p = + selected_rows_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.selected_rows) + return p != NULL + ? *p + : *reinterpret_cast< + const ::paddle_mobile::framework::proto::VarType_TensorDesc + *>(&::paddle_mobile::framework::proto:: + _VarType_TensorDesc_default_instance_); } inline ::paddle_mobile::framework::proto::VarType_TensorDesc * VarType::mutable_selected_rows() { - set_has_selected_rows(); - if (selected_rows_ == NULL) { - selected_rows_ = - new ::paddle_mobile::framework::proto::VarType_TensorDesc; - } - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.selected_rows) - return selected_rows_; + set_has_selected_rows(); + if (selected_rows_ == NULL) { + selected_rows_ = new ::paddle_mobile::framework::proto::VarType_TensorDesc; + } + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.selected_rows) + return selected_rows_; } inline ::paddle_mobile::framework::proto::VarType_TensorDesc * VarType::release_selected_rows() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.selected_rows) - clear_has_selected_rows(); - ::paddle_mobile::framework::proto::VarType_TensorDesc *temp = - selected_rows_; - selected_rows_ = NULL; - return temp; + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.selected_rows) + clear_has_selected_rows(); + ::paddle_mobile::framework::proto::VarType_TensorDesc *temp = selected_rows_; + selected_rows_ = NULL; + return temp; } inline void VarType::set_allocated_selected_rows( ::paddle_mobile::framework::proto::VarType_TensorDesc *selected_rows) { - delete selected_rows_; - selected_rows_ = selected_rows; - if (selected_rows) { - set_has_selected_rows(); - } else { - clear_has_selected_rows(); - } - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.selected_rows) + delete selected_rows_; + selected_rows_ = selected_rows; + if (selected_rows) { + set_has_selected_rows(); + } else { + clear_has_selected_rows(); + } + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.selected_rows) } // optional .paddle_mobile.framework.proto.VarType.LoDTensorDesc // lod_tensor = 3; inline bool VarType::has_lod_tensor() const { - return (_has_bits_[0] & 0x00000002u) != 0; + return (_has_bits_[0] & 0x00000002u) != 0; } inline void VarType::set_has_lod_tensor() { _has_bits_[0] |= 0x00000002u; } inline void VarType::clear_has_lod_tensor() { _has_bits_[0] &= ~0x00000002u; } inline void VarType::clear_lod_tensor() { - if (lod_tensor_ != NULL) - lod_tensor_ - ->::paddle_mobile::framework::proto::VarType_LoDTensorDesc::Clear(); - clear_has_lod_tensor(); + if (lod_tensor_ != NULL) + lod_tensor_ + ->::paddle_mobile::framework::proto::VarType_LoDTensorDesc::Clear(); + clear_has_lod_tensor(); } inline const ::paddle_mobile::framework::proto::VarType_LoDTensorDesc & VarType::lod_tensor() const { - const ::paddle_mobile::framework::proto::VarType_LoDTensorDesc *p = - lod_tensor_; - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.lod_tensor) - return p != NULL ? *p - : *reinterpret_cast( - &::paddle_mobile::framework::proto:: - _VarType_LoDTensorDesc_default_instance_); + const ::paddle_mobile::framework::proto::VarType_LoDTensorDesc *p = + lod_tensor_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.lod_tensor) + return p != NULL ? *p + : *reinterpret_cast( + &::paddle_mobile::framework::proto:: + _VarType_LoDTensorDesc_default_instance_); } inline ::paddle_mobile::framework::proto::VarType_LoDTensorDesc * VarType::mutable_lod_tensor() { - set_has_lod_tensor(); - if (lod_tensor_ == NULL) { - lod_tensor_ = - new ::paddle_mobile::framework::proto::VarType_LoDTensorDesc; - } - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.lod_tensor) - return lod_tensor_; + set_has_lod_tensor(); + if (lod_tensor_ == NULL) { + lod_tensor_ = new ::paddle_mobile::framework::proto::VarType_LoDTensorDesc; + } + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.lod_tensor) + return lod_tensor_; } inline ::paddle_mobile::framework::proto::VarType_LoDTensorDesc * VarType::release_lod_tensor() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.lod_tensor) - clear_has_lod_tensor(); - ::paddle_mobile::framework::proto::VarType_LoDTensorDesc *temp = - lod_tensor_; - lod_tensor_ = NULL; - return temp; + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.lod_tensor) + clear_has_lod_tensor(); + ::paddle_mobile::framework::proto::VarType_LoDTensorDesc *temp = lod_tensor_; + lod_tensor_ = NULL; + return temp; } inline void VarType::set_allocated_lod_tensor( ::paddle_mobile::framework::proto::VarType_LoDTensorDesc *lod_tensor) { - delete lod_tensor_; - lod_tensor_ = lod_tensor; - if (lod_tensor) { - set_has_lod_tensor(); - } else { - clear_has_lod_tensor(); - } - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.lod_tensor) + delete lod_tensor_; + lod_tensor_ = lod_tensor; + if (lod_tensor) { + set_has_lod_tensor(); + } else { + clear_has_lod_tensor(); + } + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.lod_tensor) } // optional // .paddle_mobile.framework.proto.VarType.LoDTensorArrayDesc // tensor_array = 4; inline bool VarType::has_tensor_array() const { - return (_has_bits_[0] & 0x00000004u) != 0; + return (_has_bits_[0] & 0x00000004u) != 0; } inline void VarType::set_has_tensor_array() { _has_bits_[0] |= 0x00000004u; } inline void VarType::clear_has_tensor_array() { _has_bits_[0] &= ~0x00000004u; } inline void VarType::clear_tensor_array() { - if (tensor_array_ != NULL) - tensor_array_->::paddle_mobile::framework::proto:: - VarType_LoDTensorArrayDesc::Clear(); - clear_has_tensor_array(); + if (tensor_array_ != NULL) + tensor_array_->::paddle_mobile::framework::proto:: + VarType_LoDTensorArrayDesc::Clear(); + clear_has_tensor_array(); } inline const ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc & VarType::tensor_array() const { - const ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc *p = - tensor_array_; - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.tensor_array) - return p != NULL - ? *p - : *reinterpret_cast( - &::paddle_mobile::framework::proto:: - _VarType_LoDTensorArrayDesc_default_instance_); + const ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc *p = + tensor_array_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.tensor_array) + return p != NULL ? *p + : *reinterpret_cast( + &::paddle_mobile::framework::proto:: + _VarType_LoDTensorArrayDesc_default_instance_); } inline ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc * VarType::mutable_tensor_array() { - set_has_tensor_array(); - if (tensor_array_ == NULL) { - tensor_array_ = - new ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc; - } - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.tensor_array) - return tensor_array_; + set_has_tensor_array(); + if (tensor_array_ == NULL) { + tensor_array_ = + new ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc; + } + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.tensor_array) + return tensor_array_; } inline ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc * VarType::release_tensor_array() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.tensor_array) - clear_has_tensor_array(); - ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc *temp = - tensor_array_; - tensor_array_ = NULL; - return temp; + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.tensor_array) + clear_has_tensor_array(); + ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc *temp = + tensor_array_; + tensor_array_ = NULL; + return temp; } inline void VarType::set_allocated_tensor_array( ::paddle_mobile::framework::proto::VarType_LoDTensorArrayDesc *tensor_array) { - delete tensor_array_; - tensor_array_ = tensor_array; - if (tensor_array) { - set_has_tensor_array(); - } else { - clear_has_tensor_array(); - } - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.tensor_array) + delete tensor_array_; + tensor_array_ = tensor_array; + if (tensor_array) { + set_has_tensor_array(); + } else { + clear_has_tensor_array(); + } + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.tensor_array) } // optional .paddle_mobile.framework.proto.VarType.ReaderDesc reader // = 5; inline bool VarType::has_reader() const { - return (_has_bits_[0] & 0x00000008u) != 0; + return (_has_bits_[0] & 0x00000008u) != 0; } inline void VarType::set_has_reader() { _has_bits_[0] |= 0x00000008u; } inline void VarType::clear_has_reader() { _has_bits_[0] &= ~0x00000008u; } inline void VarType::clear_reader() { - if (reader_ != NULL) - reader_->::paddle_mobile::framework::proto::VarType_ReaderDesc::Clear(); - clear_has_reader(); + if (reader_ != NULL) + reader_->::paddle_mobile::framework::proto::VarType_ReaderDesc::Clear(); + clear_has_reader(); } inline const ::paddle_mobile::framework::proto::VarType_ReaderDesc & VarType::reader() const { - const ::paddle_mobile::framework::proto::VarType_ReaderDesc *p = reader_; - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.reader) - return p != NULL - ? *p - : *reinterpret_cast< - const ::paddle_mobile::framework::proto::VarType_ReaderDesc - *>(&::paddle_mobile::framework::proto:: - _VarType_ReaderDesc_default_instance_); + const ::paddle_mobile::framework::proto::VarType_ReaderDesc *p = reader_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.reader) + return p != NULL + ? *p + : *reinterpret_cast< + const ::paddle_mobile::framework::proto::VarType_ReaderDesc + *>(&::paddle_mobile::framework::proto:: + _VarType_ReaderDesc_default_instance_); } inline ::paddle_mobile::framework::proto::VarType_ReaderDesc * VarType::mutable_reader() { - set_has_reader(); - if (reader_ == NULL) { - reader_ = new ::paddle_mobile::framework::proto::VarType_ReaderDesc; - } - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.reader) - return reader_; + set_has_reader(); + if (reader_ == NULL) { + reader_ = new ::paddle_mobile::framework::proto::VarType_ReaderDesc; + } + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.reader) + return reader_; } inline ::paddle_mobile::framework::proto::VarType_ReaderDesc * VarType::release_reader() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.reader) - clear_has_reader(); - ::paddle_mobile::framework::proto::VarType_ReaderDesc *temp = reader_; - reader_ = NULL; - return temp; + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.reader) + clear_has_reader(); + ::paddle_mobile::framework::proto::VarType_ReaderDesc *temp = reader_; + reader_ = NULL; + return temp; } inline void VarType::set_allocated_reader( ::paddle_mobile::framework::proto::VarType_ReaderDesc *reader) { - delete reader_; - reader_ = reader; - if (reader) { - set_has_reader(); - } else { - clear_has_reader(); - } - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.reader) + delete reader_; + reader_ = reader; + if (reader) { + set_has_reader(); + } else { + clear_has_reader(); + } + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.reader) } // optional .paddle_mobile.framework.proto.VarType.ChannelDesc // channel = 6; inline bool VarType::has_channel() const { - return (_has_bits_[0] & 0x00000010u) != 0; + return (_has_bits_[0] & 0x00000010u) != 0; } inline void VarType::set_has_channel() { _has_bits_[0] |= 0x00000010u; } inline void VarType::clear_has_channel() { _has_bits_[0] &= ~0x00000010u; } inline void VarType::clear_channel() { - if (channel_ != NULL) - channel_ - ->::paddle_mobile::framework::proto::VarType_ChannelDesc::Clear(); - clear_has_channel(); + if (channel_ != NULL) + channel_->::paddle_mobile::framework::proto::VarType_ChannelDesc::Clear(); + clear_has_channel(); } inline const ::paddle_mobile::framework::proto::VarType_ChannelDesc & VarType::channel() const { - const ::paddle_mobile::framework::proto::VarType_ChannelDesc *p = channel_; - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.channel) - return p != NULL ? *p - : *reinterpret_cast( - &::paddle_mobile::framework::proto:: - _VarType_ChannelDesc_default_instance_); + const ::paddle_mobile::framework::proto::VarType_ChannelDesc *p = channel_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.channel) + return p != NULL + ? *p + : *reinterpret_cast< + const ::paddle_mobile::framework::proto::VarType_ChannelDesc + *>(&::paddle_mobile::framework::proto:: + _VarType_ChannelDesc_default_instance_); } inline ::paddle_mobile::framework::proto::VarType_ChannelDesc * VarType::mutable_channel() { - set_has_channel(); - if (channel_ == NULL) { - channel_ = new ::paddle_mobile::framework::proto::VarType_ChannelDesc; - } - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.channel) - return channel_; + set_has_channel(); + if (channel_ == NULL) { + channel_ = new ::paddle_mobile::framework::proto::VarType_ChannelDesc; + } + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.channel) + return channel_; } inline ::paddle_mobile::framework::proto::VarType_ChannelDesc * VarType::release_channel() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.channel) - clear_has_channel(); - ::paddle_mobile::framework::proto::VarType_ChannelDesc *temp = channel_; - channel_ = NULL; - return temp; + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.channel) + clear_has_channel(); + ::paddle_mobile::framework::proto::VarType_ChannelDesc *temp = channel_; + channel_ = NULL; + return temp; } inline void VarType::set_allocated_channel( ::paddle_mobile::framework::proto::VarType_ChannelDesc *channel) { - delete channel_; - channel_ = channel; - if (channel) { - set_has_channel(); - } else { - clear_has_channel(); - } - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.channel) + delete channel_; + channel_ = channel; + if (channel) { + set_has_channel(); + } else { + clear_has_channel(); + } + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.channel) } // optional .paddle_mobile.framework.proto.VarType.Tuple tuple = 7; inline bool VarType::has_tuple() const { - return (_has_bits_[0] & 0x00000020u) != 0; + return (_has_bits_[0] & 0x00000020u) != 0; } inline void VarType::set_has_tuple() { _has_bits_[0] |= 0x00000020u; } inline void VarType::clear_has_tuple() { _has_bits_[0] &= ~0x00000020u; } inline void VarType::clear_tuple() { - if (tuple_ != NULL) - tuple_->::paddle_mobile::framework::proto::VarType_Tuple::Clear(); - clear_has_tuple(); + if (tuple_ != NULL) + tuple_->::paddle_mobile::framework::proto::VarType_Tuple::Clear(); + clear_has_tuple(); } inline const ::paddle_mobile::framework::proto::VarType_Tuple & VarType::tuple() const { - const ::paddle_mobile::framework::proto::VarType_Tuple *p = tuple_; - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.tuple) - return p != NULL - ? *p - : *reinterpret_cast< - const ::paddle_mobile::framework::proto::VarType_Tuple *>( - &::paddle_mobile::framework::proto:: - _VarType_Tuple_default_instance_); + const ::paddle_mobile::framework::proto::VarType_Tuple *p = tuple_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarType.tuple) + return p != NULL + ? *p + : *reinterpret_cast< + const ::paddle_mobile::framework::proto::VarType_Tuple *>( + &::paddle_mobile::framework::proto:: + _VarType_Tuple_default_instance_); } inline ::paddle_mobile::framework::proto::VarType_Tuple * VarType::mutable_tuple() { - set_has_tuple(); - if (tuple_ == NULL) { - tuple_ = new ::paddle_mobile::framework::proto::VarType_Tuple; - } - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.tuple) - return tuple_; + set_has_tuple(); + if (tuple_ == NULL) { + tuple_ = new ::paddle_mobile::framework::proto::VarType_Tuple; + } + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarType.tuple) + return tuple_; } inline ::paddle_mobile::framework::proto::VarType_Tuple * VarType::release_tuple() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.tuple) - clear_has_tuple(); - ::paddle_mobile::framework::proto::VarType_Tuple *temp = tuple_; - tuple_ = NULL; - return temp; + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarType.tuple) + clear_has_tuple(); + ::paddle_mobile::framework::proto::VarType_Tuple *temp = tuple_; + tuple_ = NULL; + return temp; } inline void VarType::set_allocated_tuple( ::paddle_mobile::framework::proto::VarType_Tuple *tuple) { - delete tuple_; - tuple_ = tuple; - if (tuple) { - set_has_tuple(); - } else { - clear_has_tuple(); - } - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.tuple) + delete tuple_; + tuple_ = tuple; + if (tuple) { + set_has_tuple(); + } else { + clear_has_tuple(); + } + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarType.tuple) } // ------------------------------------------------------------------- @@ -4744,137 +4700,134 @@ inline void VarType::set_allocated_tuple( // required string name = 1; inline bool VarDesc::has_name() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } inline void VarDesc::set_has_name() { _has_bits_[0] |= 0x00000001u; } inline void VarDesc::clear_has_name() { _has_bits_[0] &= ~0x00000001u; } inline void VarDesc::clear_name() { - name_.ClearToEmptyNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); - clear_has_name(); + name_.ClearToEmptyNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); } inline const ::std::string &VarDesc::name() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarDesc.name) - return name_.GetNoArena(); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarDesc.name) + return name_.GetNoArena(); } inline void VarDesc::set_name(const ::std::string &value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarDesc.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + value); + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarDesc.name) } #if LANG_CXX11 inline void VarDesc::set_name(::std::string &&value) { - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::move(value)); - // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.VarDesc.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::move(value)); + // @@protoc_insertion_point(field_set_rvalue:paddle_mobile.framework.proto.VarDesc.name) } #endif inline void VarDesc::set_name(const char *value) { - GOOGLE_DCHECK(value != NULL); - set_has_name(); - name_.SetNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited(), - ::std::string(value)); - // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.VarDesc.name) + GOOGLE_DCHECK(value != NULL); + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:paddle_mobile.framework.proto.VarDesc.name) } inline void VarDesc::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:paddle_mobile.framework.proto.VarDesc.name) + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:paddle_mobile.framework.proto.VarDesc.name) } inline ::std::string *VarDesc::mutable_name() { - set_has_name(); - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarDesc.name) - return name_.MutableNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + set_has_name(); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarDesc.name) + return name_.MutableNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline ::std::string *VarDesc::release_name() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarDesc.name) - clear_has_name(); - return name_.ReleaseNoArena( - &::google::protobuf::internal::GetEmptyStringAlreadyInited()); + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarDesc.name) + clear_has_name(); + return name_.ReleaseNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void VarDesc::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:paddle_mobile.framework.proto.VarDesc.name) + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena( + &::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarDesc.name) } // required .paddle_mobile.framework.proto.VarType type = 2; inline bool VarDesc::has_type() const { - return (_has_bits_[0] & 0x00000002u) != 0; + return (_has_bits_[0] & 0x00000002u) != 0; } inline void VarDesc::set_has_type() { _has_bits_[0] |= 0x00000002u; } inline void VarDesc::clear_has_type() { _has_bits_[0] &= ~0x00000002u; } inline void VarDesc::clear_type() { - if (type_ != NULL) - type_->::paddle_mobile::framework::proto::VarType::Clear(); - clear_has_type(); + if (type_ != NULL) + type_->::paddle_mobile::framework::proto::VarType::Clear(); + clear_has_type(); } inline const ::paddle_mobile::framework::proto::VarType &VarDesc::type() const { - const ::paddle_mobile::framework::proto::VarType *p = type_; - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarDesc.type) - return p != NULL ? *p - : *reinterpret_cast< - const ::paddle_mobile::framework::proto::VarType *>( - &::paddle_mobile::framework::proto:: - _VarType_default_instance_); + const ::paddle_mobile::framework::proto::VarType *p = type_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarDesc.type) + return p != NULL ? *p + : *reinterpret_cast< + const ::paddle_mobile::framework::proto::VarType *>( + &::paddle_mobile::framework::proto:: + _VarType_default_instance_); } inline ::paddle_mobile::framework::proto::VarType *VarDesc::mutable_type() { - set_has_type(); - if (type_ == NULL) { - type_ = new ::paddle_mobile::framework::proto::VarType; - } - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarDesc.type) - return type_; + set_has_type(); + if (type_ == NULL) { + type_ = new ::paddle_mobile::framework::proto::VarType; + } + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.VarDesc.type) + return type_; } inline ::paddle_mobile::framework::proto::VarType *VarDesc::release_type() { - // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarDesc.type) - clear_has_type(); - ::paddle_mobile::framework::proto::VarType *temp = type_; - type_ = NULL; - return temp; + // @@protoc_insertion_point(field_release:paddle_mobile.framework.proto.VarDesc.type) + clear_has_type(); + ::paddle_mobile::framework::proto::VarType *temp = type_; + type_ = NULL; + return temp; } inline void VarDesc::set_allocated_type(::paddle_mobile::framework::proto::VarType *type) { - delete type_; - type_ = type; - if (type) { - set_has_type(); - } else { - clear_has_type(); - } - // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarDesc.type) + delete type_; + type_ = type; + if (type) { + set_has_type(); + } else { + clear_has_type(); + } + // @@protoc_insertion_point(field_set_allocated:paddle_mobile.framework.proto.VarDesc.type) } // optional bool persistable = 3 [default = false]; inline bool VarDesc::has_persistable() const { - return (_has_bits_[0] & 0x00000004u) != 0; + return (_has_bits_[0] & 0x00000004u) != 0; } inline void VarDesc::set_has_persistable() { _has_bits_[0] |= 0x00000004u; } inline void VarDesc::clear_has_persistable() { _has_bits_[0] &= ~0x00000004u; } inline void VarDesc::clear_persistable() { - persistable_ = false; - clear_has_persistable(); + persistable_ = false; + clear_has_persistable(); } inline bool VarDesc::persistable() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarDesc.persistable) - return persistable_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.VarDesc.persistable) + return persistable_; } inline void VarDesc::set_persistable(bool value) { - set_has_persistable(); - persistable_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarDesc.persistable) + set_has_persistable(); + persistable_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.VarDesc.persistable) } // ------------------------------------------------------------------- @@ -4883,42 +4836,42 @@ inline void VarDesc::set_persistable(bool value) { // required int32 idx = 1; inline bool BlockDesc::has_idx() const { - return (_has_bits_[0] & 0x00000001u) != 0; + return (_has_bits_[0] & 0x00000001u) != 0; } inline void BlockDesc::set_has_idx() { _has_bits_[0] |= 0x00000001u; } inline void BlockDesc::clear_has_idx() { _has_bits_[0] &= ~0x00000001u; } inline void BlockDesc::clear_idx() { - idx_ = 0; - clear_has_idx(); + idx_ = 0; + clear_has_idx(); } inline ::google::protobuf::int32 BlockDesc::idx() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.idx) - return idx_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.idx) + return idx_; } inline void BlockDesc::set_idx(::google::protobuf::int32 value) { - set_has_idx(); - idx_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.BlockDesc.idx) + set_has_idx(); + idx_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.BlockDesc.idx) } // required int32 parent_idx = 2; inline bool BlockDesc::has_parent_idx() const { - return (_has_bits_[0] & 0x00000002u) != 0; + return (_has_bits_[0] & 0x00000002u) != 0; } inline void BlockDesc::set_has_parent_idx() { _has_bits_[0] |= 0x00000002u; } inline void BlockDesc::clear_has_parent_idx() { _has_bits_[0] &= ~0x00000002u; } inline void BlockDesc::clear_parent_idx() { - parent_idx_ = 0; - clear_has_parent_idx(); + parent_idx_ = 0; + clear_has_parent_idx(); } inline ::google::protobuf::int32 BlockDesc::parent_idx() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.parent_idx) - return parent_idx_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.parent_idx) + return parent_idx_; } inline void BlockDesc::set_parent_idx(::google::protobuf::int32 value) { - set_has_parent_idx(); - parent_idx_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.BlockDesc.parent_idx) + set_has_parent_idx(); + parent_idx_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.BlockDesc.parent_idx) } // repeated .paddle_mobile.framework.proto.VarDesc vars = 3; @@ -4926,29 +4879,29 @@ inline int BlockDesc::vars_size() const { return vars_.size(); } inline void BlockDesc::clear_vars() { vars_.Clear(); } inline const ::paddle_mobile::framework::proto::VarDesc & BlockDesc::vars(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.vars) - return vars_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.vars) + return vars_.Get(index); } inline ::paddle_mobile::framework::proto::VarDesc * BlockDesc::mutable_vars(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.BlockDesc.vars) - return vars_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.BlockDesc.vars) + return vars_.Mutable(index); } inline ::paddle_mobile::framework::proto::VarDesc *BlockDesc::add_vars() { - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.BlockDesc.vars) - return vars_.Add(); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.BlockDesc.vars) + return vars_.Add(); } inline ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::VarDesc> * BlockDesc::mutable_vars() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.BlockDesc.vars) - return &vars_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.BlockDesc.vars) + return &vars_; } inline const ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::VarDesc> & BlockDesc::vars() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.BlockDesc.vars) - return vars_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.BlockDesc.vars) + return vars_; } // repeated .paddle_mobile.framework.proto.OpDesc ops = 4; @@ -4956,53 +4909,53 @@ inline int BlockDesc::ops_size() const { return ops_.size(); } inline void BlockDesc::clear_ops() { ops_.Clear(); } inline const ::paddle_mobile::framework::proto::OpDesc & BlockDesc::ops(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.ops) - return ops_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.ops) + return ops_.Get(index); } inline ::paddle_mobile::framework::proto::OpDesc * BlockDesc::mutable_ops(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.BlockDesc.ops) - return ops_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.BlockDesc.ops) + return ops_.Mutable(index); } inline ::paddle_mobile::framework::proto::OpDesc *BlockDesc::add_ops() { - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.BlockDesc.ops) - return ops_.Add(); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.BlockDesc.ops) + return ops_.Add(); } inline ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpDesc> * BlockDesc::mutable_ops() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.BlockDesc.ops) - return &ops_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.BlockDesc.ops) + return &ops_; } inline const ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::OpDesc> & BlockDesc::ops() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.BlockDesc.ops) - return ops_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.BlockDesc.ops) + return ops_; } // optional int32 forward_block_idx = 5 [default = -1]; inline bool BlockDesc::has_forward_block_idx() const { - return (_has_bits_[0] & 0x00000004u) != 0; + return (_has_bits_[0] & 0x00000004u) != 0; } inline void BlockDesc::set_has_forward_block_idx() { - _has_bits_[0] |= 0x00000004u; + _has_bits_[0] |= 0x00000004u; } inline void BlockDesc::clear_has_forward_block_idx() { - _has_bits_[0] &= ~0x00000004u; + _has_bits_[0] &= ~0x00000004u; } inline void BlockDesc::clear_forward_block_idx() { - forward_block_idx_ = -1; - clear_has_forward_block_idx(); + forward_block_idx_ = -1; + clear_has_forward_block_idx(); } inline ::google::protobuf::int32 BlockDesc::forward_block_idx() const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.forward_block_idx) - return forward_block_idx_; + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.BlockDesc.forward_block_idx) + return forward_block_idx_; } inline void BlockDesc::set_forward_block_idx(::google::protobuf::int32 value) { - set_has_forward_block_idx(); - forward_block_idx_ = value; - // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.BlockDesc.forward_block_idx) + set_has_forward_block_idx(); + forward_block_idx_ = value; + // @@protoc_insertion_point(field_set:paddle_mobile.framework.proto.BlockDesc.forward_block_idx) } // ------------------------------------------------------------------- @@ -5014,29 +4967,29 @@ inline int ProgramDesc::blocks_size() const { return blocks_.size(); } inline void ProgramDesc::clear_blocks() { blocks_.Clear(); } inline const ::paddle_mobile::framework::proto::BlockDesc & ProgramDesc::blocks(int index) const { - // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.ProgramDesc.blocks) - return blocks_.Get(index); + // @@protoc_insertion_point(field_get:paddle_mobile.framework.proto.ProgramDesc.blocks) + return blocks_.Get(index); } inline ::paddle_mobile::framework::proto::BlockDesc * ProgramDesc::mutable_blocks(int index) { - // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.ProgramDesc.blocks) - return blocks_.Mutable(index); + // @@protoc_insertion_point(field_mutable:paddle_mobile.framework.proto.ProgramDesc.blocks) + return blocks_.Mutable(index); } inline ::paddle_mobile::framework::proto::BlockDesc *ProgramDesc::add_blocks() { - // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.ProgramDesc.blocks) - return blocks_.Add(); + // @@protoc_insertion_point(field_add:paddle_mobile.framework.proto.ProgramDesc.blocks) + return blocks_.Add(); } inline ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::BlockDesc> * ProgramDesc::mutable_blocks() { - // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.ProgramDesc.blocks) - return &blocks_; + // @@protoc_insertion_point(field_mutable_list:paddle_mobile.framework.proto.ProgramDesc.blocks) + return &blocks_; } inline const ::google::protobuf::RepeatedPtrField< ::paddle_mobile::framework::proto::BlockDesc> & ProgramDesc::blocks() const { - // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.ProgramDesc.blocks) - return blocks_; + // @@protoc_insertion_point(field_list:paddle_mobile.framework.proto.ProgramDesc.blocks) + return blocks_; } #ifdef __GNUC__ diff --git a/src/framework/lod_tensor.cc b/src/framework/lod_tensor.cc index f9fac3b438eceb20ab32858ef7366a3fef5e0d70..a76dc99a546caae5cfc4bac491da7e186462889d 100644 --- a/src/framework/lod_tensor.cc +++ b/src/framework/lod_tensor.cc @@ -22,291 +22,289 @@ namespace paddle_mobile { namespace framework { std::ostream &operator<<(std::ostream &os, const LoD &lod) { + os << "{"; + for (auto &v : lod) { os << "{"; - for (auto &v : lod) { - os << "{"; - bool is_first = true; - for (auto &i : v) { - if (is_first) { - os << i; - is_first = false; - } else { - os << ", " << i; - } - } - os << "}"; + bool is_first = true; + for (auto &i : v) { + if (is_first) { + os << i; + is_first = false; + } else { + os << ", " << i; + } } os << "}"; + } + os << "}"; - return os; + return os; } std::ostream &operator<<(std::ostream &os, const LoDTensor &t) { - // PADDLE_ENFORCE(t.type().hash_code() == - // typeid(float).hash_code()); - - // if (!platform::is_cpu_place(t.place())) { - // LoDTensor tt; - // framework::TensorCopy(t, platform::CPUPlace(), &tt); - // platform::DeviceContextPool &pool = - // platform::DeviceContextPool::Instance(); auto &dev_ctx = - // *pool.Get(t.place()); dev_ctx.Wait(); - // - // os << tt; - // return os; - // } - - os << "dim: " << t.dims() << "\n"; - os << "lod: " << t.lod() << "\n"; - - // only print first ten elements - int64_t size = t.numel() < 10 ? t.numel() : 10; - for (int64_t i = 0; i < size; ++i) { - os << t.data()[i] << " "; - } - - return os; + // PADDLE_ENFORCE(t.type().hash_code() == + // typeid(float).hash_code()); + + // if (!platform::is_cpu_place(t.place())) { + // LoDTensor tt; + // framework::TensorCopy(t, platform::CPUPlace(), &tt); + // platform::DeviceContextPool &pool = + // platform::DeviceContextPool::Instance(); auto &dev_ctx = + // *pool.Get(t.place()); dev_ctx.Wait(); + // + // os << tt; + // return os; + // } + + os << "dim: " << t.dims() << "\n"; + os << "lod: " << t.lod() << "\n"; + + // only print first ten elements + int64_t size = t.numel() < 10 ? t.numel() : 10; + for (int64_t i = 0; i < size; ++i) { + os << t.data()[i] << " "; + } + + return os; } std::string LoDToString(const LoD &lod) { - std::ostringstream stream; - stream << lod; - return stream.str(); + std::ostringstream stream; + stream << lod; + return stream.str(); } LoD SliceInLevel(const LoD &in, size_t level, size_t elem_begin, size_t elem_end) { - // PADDLE_ENFORCE_LT(level, in.size()); - // PADDLE_ENFORCE_LT(elem_end, in[level].size()); - - LoD res; - res.resize(in.size() - level); - // copy the first level - res[0].assign(in[level].begin() + elem_begin, - in[level].begin() + elem_end + 1); - for (size_t lvl = 1; lvl < res.size(); lvl++) { - const auto &in_level = in[level + lvl]; - const auto &above_level = res[lvl - 1]; - auto &out_level = res[lvl]; - out_level.assign(in_level.begin() + above_level.front(), - in_level.begin() + above_level.back() + 1); - } - for (size_t lvl = 0; lvl < res.size(); lvl++) { - // to make the first offset equals 0, all the elements minus the - // first - // element - size_t front = res[lvl].front(); - for (auto &ele : res[lvl]) { - ele -= front; - } + // PADDLE_ENFORCE_LT(level, in.size()); + // PADDLE_ENFORCE_LT(elem_end, in[level].size()); + + LoD res; + res.resize(in.size() - level); + // copy the first level + res[0].assign(in[level].begin() + elem_begin, + in[level].begin() + elem_end + 1); + for (size_t lvl = 1; lvl < res.size(); lvl++) { + const auto &in_level = in[level + lvl]; + const auto &above_level = res[lvl - 1]; + auto &out_level = res[lvl]; + out_level.assign(in_level.begin() + above_level.front(), + in_level.begin() + above_level.back() + 1); + } + for (size_t lvl = 0; lvl < res.size(); lvl++) { + // to make the first offset equals 0, all the elements minus the + // first + // element + size_t front = res[lvl].front(); + for (auto &ele : res[lvl]) { + ele -= front; } - return res; + } + return res; } LoD ToAbsOffset(const LoD &in) { - // the lowest level stores relative offsets - if (in.empty() || in.size() == 1) - return in; - LoD result = in; - for (auto level = static_cast(in.size() - 2); level >= 0; level--) { - for (size_t i = 0; i < in[level].size(); ++i) { - size_t index = in[level][i]; - result[level][i] = result[level + 1][index]; - } + // the lowest level stores relative offsets + if (in.empty() || in.size() == 1) + return in; + LoD result = in; + for (auto level = static_cast(in.size() - 2); level >= 0; level--) { + for (size_t i = 0; i < in[level].size(); ++i) { + size_t index = in[level][i]; + result[level][i] = result[level + 1][index]; } - return result; + } + return result; } bool operator==(const LoD &a, const LoD &b) { - if (a.size() != b.size()) { - return false; + if (a.size() != b.size()) { + return false; + } + + for (size_t i = 0; i < a.size(); i++) { + const auto &a_level = a[i]; + const auto &b_level = b[i]; + if (a_level.size() != b_level.size()) { + return false; } - - for (size_t i = 0; i < a.size(); i++) { - const auto &a_level = a[i]; - const auto &b_level = b[i]; - if (a_level.size() != b_level.size()) { - return false; - } - for (size_t j = 0; j < a_level.size(); j++) { - if (a_level[j] != b_level[j]) { - return false; - } - } + for (size_t j = 0; j < a_level.size(); j++) { + if (a_level[j] != b_level[j]) { + return false; + } } - return true; + } + return true; } bool CheckLoD(const LoD &in, int tensor_height) { - if (in.empty()) - return true; - for (const auto &level : in) { - // check: there should be more than 2 offsets existing in each - // level. - if (level.size() < 2) - return false; - // check: the first offset(the begin offset) of each level - // should be 0. - if (level.front() != 0) - return false; - // check: all the offsets in a level should be ascending(no same - // items - // allows). - if (!std::is_sorted(level.begin(), level.begin(), - [](size_t a, size_t b) { - if (a < b) - return true; - return false; - })) { - std::cout << "ascending error"; - return false; - } - } - // check: the lowest level's last offset should equals - // `tensor_height` if - // tensor_height>0. - if (tensor_height > 0 && (size_t)tensor_height != in.back().back()) - return false; - - // check: the higher level's last offset should equals the lower - // level's - // size-1. - // NOTE LoD store the levels from top to bottom, so the higher level - // goes - // first. - for (size_t level = 0; level < in.size() - 1; level++) { - if (in[level].back() != in[level + 1].size() - 1) - return false; - } + if (in.empty()) return true; + for (const auto &level : in) { + // check: there should be more than 2 offsets existing in each + // level. + if (level.size() < 2) + return false; + // check: the first offset(the begin offset) of each level + // should be 0. + if (level.front() != 0) + return false; + // check: all the offsets in a level should be ascending(no same + // items + // allows). + if (!std::is_sorted(level.begin(), level.begin(), [](size_t a, size_t b) { + if (a < b) + return true; + return false; + })) { + std::cout << "ascending error"; + return false; + } + } + // check: the lowest level's last offset should equals + // `tensor_height` if + // tensor_height>0. + if (tensor_height > 0 && (size_t)tensor_height != in.back().back()) + return false; + + // check: the higher level's last offset should equals the lower + // level's + // size-1. + // NOTE LoD store the levels from top to bottom, so the higher level + // goes + // first. + for (size_t level = 0; level < in.size() - 1; level++) { + if (in[level].back() != in[level + 1].size() - 1) + return false; + } + return true; } bool CheckAbsLoD(const LoD &in, int tensor_height) { - if (in.empty()) - return true; - for (const auto &level : in) { - // check: all the offsets in a level should be ascending(no same - // items - // allows). - if (!std::is_sorted(level.begin(), level.begin(), - [](size_t a, size_t b) { - if (a < b) - return true; - return false; - })) { - return false; - } - - // check: there should be more than 2 offsets existing in each - // level. - if (level.size() < 2) - return false; - - // check: the first offset of each level should be 0, and the - // last should be - // the same(the height of underlying tensor). - if (level.front() != 0) - return false; - if (tensor_height < 0) { - tensor_height = level.back(); - } else if ((size_t)tensor_height != level.back()) { - return false; - } - } + if (in.empty()) return true; + for (const auto &level : in) { + // check: all the offsets in a level should be ascending(no same + // items + // allows). + if (!std::is_sorted(level.begin(), level.begin(), [](size_t a, size_t b) { + if (a < b) + return true; + return false; + })) { + return false; + } + + // check: there should be more than 2 offsets existing in each + // level. + if (level.size() < 2) + return false; + + // check: the first offset of each level should be 0, and the + // last should be + // the same(the height of underlying tensor). + if (level.front() != 0) + return false; + if (tensor_height < 0) { + tensor_height = level.back(); + } else if ((size_t)tensor_height != level.back()) { + return false; + } + } + return true; } using LoDAndOffset = std::pair>; LoDAndOffset GetSubLoDAndAbsoluteOffset(const LoD &lod, size_t start_idx, size_t end_idx, size_t start_level) { - LoD sub_lod; - - for (size_t level_idx = start_level; level_idx < lod.size(); ++level_idx) { - // PADDLE_ENFORCE_LE(start_idx, end_idx); - // PADDLE_ENFORCE_LT(end_idx, lod[level_idx].size()); - std::vector level_lens; - for (size_t i = start_idx; i < end_idx; ++i) { - level_lens.push_back(lod[level_idx][i + 1] - lod[level_idx][i]); - } - sub_lod.emplace_back(level_lens); - start_idx = lod[level_idx][start_idx]; - end_idx = lod[level_idx][end_idx]; + LoD sub_lod; + + for (size_t level_idx = start_level; level_idx < lod.size(); ++level_idx) { + // PADDLE_ENFORCE_LE(start_idx, end_idx); + // PADDLE_ENFORCE_LT(end_idx, lod[level_idx].size()); + std::vector level_lens; + for (size_t i = start_idx; i < end_idx; ++i) { + level_lens.push_back(lod[level_idx][i + 1] - lod[level_idx][i]); } + sub_lod.emplace_back(level_lens); + start_idx = lod[level_idx][start_idx]; + end_idx = lod[level_idx][end_idx]; + } - return LoDAndOffset{sub_lod, {start_idx, end_idx}}; + return LoDAndOffset{sub_lod, {start_idx, end_idx}}; } void AppendLoD(LoD *lod, const LoD &lod_length) { - // PADDLE_ENFORCE( - // lod->empty() || lod->size() == lod_length.size(), - // "The lod_length should has the same size with the appended - // lod."); - if (lod->empty()) { - for (size_t i = 0; i < lod_length.size(); ++i) { - lod->emplace_back(1, 0); // size = 1, value = 0; - } - *lod = LoD(lod_length.size(), std::vector({0})); + // PADDLE_ENFORCE( + // lod->empty() || lod->size() == lod_length.size(), + // "The lod_length should has the same size with the appended + // lod."); + if (lod->empty()) { + for (size_t i = 0; i < lod_length.size(); ++i) { + lod->emplace_back(1, 0); // size = 1, value = 0; } - for (size_t i = 0; i < lod->size(); ++i) { - auto &level = (*lod)[i]; - for (size_t len : lod_length[i]) { - level.push_back(level.back() + len); - } + *lod = LoD(lod_length.size(), std::vector({0})); + } + for (size_t i = 0; i < lod->size(); ++i) { + auto &level = (*lod)[i]; + for (size_t len : lod_length[i]) { + level.push_back(level.back() + len); } + } } void SerializeToStream(std::ostream &os, const LoDTensor &tensor) { - { // the 1st field, uint32_t version for LoDTensor - constexpr uint32_t version = 0; - os.write(reinterpret_cast(&version), sizeof(version)); + { // the 1st field, uint32_t version for LoDTensor + constexpr uint32_t version = 0; + os.write(reinterpret_cast(&version), sizeof(version)); + } + { + // the 2st field, LoD information + // uint64_t lod_level + // uint64_t lod_level_1 size in byte. + // int* lod_level_1 data + // ... + auto lod = tensor.lod(); + uint64_t size = lod.size(); + os.write(reinterpret_cast(&size), sizeof(size)); + + for (auto &each : lod) { + size = each.size() * sizeof(framework::LoD::value_type::value_type); + os.write(reinterpret_cast(&size), sizeof(size)); + os.write(reinterpret_cast(each.data()), + static_cast(size)); } - { - // the 2st field, LoD information - // uint64_t lod_level - // uint64_t lod_level_1 size in byte. - // int* lod_level_1 data - // ... - auto lod = tensor.lod(); - uint64_t size = lod.size(); - os.write(reinterpret_cast(&size), sizeof(size)); - - for (auto &each : lod) { - size = each.size() * sizeof(framework::LoD::value_type::value_type); - os.write(reinterpret_cast(&size), sizeof(size)); - os.write(reinterpret_cast(each.data()), - static_cast(size)); - } - } - // the 3st field, Tensor - TensorToStream(os, static_cast(tensor)); + } + // the 3st field, Tensor + TensorToStream(os, static_cast(tensor)); } void DeserializeFromStream(std::istream &is, LoDTensor *tensor) { - { - // the 1st field, unit32_t version for LoDTensor - uint32_t version; - is.read(reinterpret_cast(&version), sizeof(version)); - // PADDLE_ENFORCE_EQ(version, 0U, "Only version 0 is - // supported"); - } - { - // the 2st field, LoD information - uint64_t lod_level; - is.read(reinterpret_cast(&lod_level), sizeof(lod_level)); - auto &lod = *tensor->mutable_lod(); - lod.resize(lod_level); - for (uint64_t i = 0; i < lod_level; ++i) { - uint64_t size; - is.read(reinterpret_cast(&size), sizeof(size)); - std::vector tmp(size / sizeof(size_t)); - is.read(reinterpret_cast(tmp.data()), - static_cast(size)); - lod[i] = tmp; - } + { + // the 1st field, unit32_t version for LoDTensor + uint32_t version; + is.read(reinterpret_cast(&version), sizeof(version)); + // PADDLE_ENFORCE_EQ(version, 0U, "Only version 0 is + // supported"); + } + { + // the 2st field, LoD information + uint64_t lod_level; + is.read(reinterpret_cast(&lod_level), sizeof(lod_level)); + auto &lod = *tensor->mutable_lod(); + lod.resize(lod_level); + for (uint64_t i = 0; i < lod_level; ++i) { + uint64_t size; + is.read(reinterpret_cast(&size), sizeof(size)); + std::vector tmp(size / sizeof(size_t)); + is.read(reinterpret_cast(tmp.data()), + static_cast(size)); + lod[i] = tmp; } - // the 3st filed, Tensor - TensorFromStream(is, static_cast(tensor)); + } + // the 3st filed, Tensor + TensorFromStream(is, static_cast(tensor)); } } // namespace framework diff --git a/src/framework/lod_tensor.h b/src/framework/lod_tensor.h index 87bfbf10a5745be18412f2596c02f165059d3e98..be4e268ca266ecb552fe4a66888324296d152f49 100644 --- a/src/framework/lod_tensor.h +++ b/src/framework/lod_tensor.h @@ -102,45 +102,45 @@ bool CheckAbsLoD(const LoD &in, int tensor_height = -1); * see https://en.wikipedia.org/wiki/Level_of_details for reference. */ class LoDTensor : public Tensor { - public: - LoDTensor() : Tensor() {} - - explicit LoDTensor(const LoD &lod) : lod_(lod) {} - - void set_lod(const LoD &lod) { lod_ = lod; } - - const LoD &lod() const { return lod_; } - - LoD *mutable_lod() { return &lod_; } - - /* - * Get the start offset and end offset of an element from LoD. - */ - std::pair lod_element(size_t level, size_t elem) const { - // PADDLE_ENFORCE_LT(level, NumLevels()); - // PADDLE_ENFORCE_LT(elem, NumElements(level)); - return std::make_pair((lod_)[level][elem], (lod_)[level][elem + 1]); - } - - /* - * Number of LoDTensor's levels, each level has units of data, for - * example, - * in the sentence's view, article, paragraph, sentence are 3 - * levels. - */ - size_t NumLevels() const { return lod_.size(); } - - /* - * Number of elements in a level. - */ - size_t NumElements(size_t level = 0) const { - // PADDLE_ENFORCE_LT(level, NumLevels()); - // the last offset is the end of last element - return (lod_)[level].size() - 1; - } - - private: - LoD lod_; +public: + LoDTensor() : Tensor() {} + + explicit LoDTensor(const LoD &lod) : lod_(lod) {} + + void set_lod(const LoD &lod) { lod_ = lod; } + + const LoD &lod() const { return lod_; } + + LoD *mutable_lod() { return &lod_; } + + /* + * Get the start offset and end offset of an element from LoD. + */ + std::pair lod_element(size_t level, size_t elem) const { + // PADDLE_ENFORCE_LT(level, NumLevels()); + // PADDLE_ENFORCE_LT(elem, NumElements(level)); + return std::make_pair((lod_)[level][elem], (lod_)[level][elem + 1]); + } + + /* + * Number of LoDTensor's levels, each level has units of data, for + * example, + * in the sentence's view, article, paragraph, sentence are 3 + * levels. + */ + size_t NumLevels() const { return lod_.size(); } + + /* + * Number of elements in a level. + */ + size_t NumElements(size_t level = 0) const { + // PADDLE_ENFORCE_LT(level, NumLevels()); + // the last offset is the end of last element + return (lod_)[level].size() - 1; + } + +private: + LoD lod_; }; /* @@ -155,26 +155,26 @@ class LoDTensor : public Tensor { */ template LoDTensor LodExpand(const LoDTensor &source, const LoD &lod, size_t level) { - LoD abs_lod = ToAbsOffset(lod); - const auto &lod_level = lod[level]; - size_t num_instances = source.dims()[0]; - - // new tensor - LoDTensor tensor; - tensor.set_lod(lod); - auto dims = source.dims(); - dims[0] = lod_level.back(); - tensor.Resize(dims); - tensor.mutable_data(); - - // PADDLE_ENFORCE_EQ(num_instances, lod_level.size() - 1); - for (size_t ins = 0; ins < num_instances; ins++) { - for (size_t elem = lod_level[ins]; elem < lod_level[ins + 1]; elem++) { - auto slice = tensor.Slice(elem, elem + 1); - TensorCopy(source.Slice(ins, ins + 1), &slice); - } + LoD abs_lod = ToAbsOffset(lod); + const auto &lod_level = lod[level]; + size_t num_instances = source.dims()[0]; + + // new tensor + LoDTensor tensor; + tensor.set_lod(lod); + auto dims = source.dims(); + dims[0] = lod_level.back(); + tensor.Resize(dims); + tensor.mutable_data(); + + // PADDLE_ENFORCE_EQ(num_instances, lod_level.size() - 1); + for (size_t ins = 0; ins < num_instances; ins++) { + for (size_t elem = lod_level[ins]; elem < lod_level[ins + 1]; elem++) { + auto slice = tensor.Slice(elem, elem + 1); + TensorCopy(source.Slice(ins, ins + 1), &slice); } - return tensor; + } + return tensor; } // Get the absolute offset of a lod[start_level][start_idx:end_idx] and diff --git a/src/framework/op_desc.cpp b/src/framework/op_desc.cpp index aa49a3533ca3672ba9e7c531ddf5fbf74b6dadeb..f6a5cf68ff1608eac3a771a11175e5823f318869 100644 --- a/src/framework/op_desc.cpp +++ b/src/framework/op_desc.cpp @@ -8,51 +8,51 @@ namespace paddle_mobile { namespace framework { OpDesc::OpDesc(const proto::OpDesc &desc) : desc_(desc) { - for (int i = 0; i < desc_.inputs_size(); ++i) { - const proto::OpDesc::Var &var = desc_.inputs(i); - std::vector &args = inputs_[var.parameter()]; - int arg_size = var.arguments_size(); - for (int j = 0; j < arg_size; ++j) { - args.push_back(var.arguments(j)); - } + for (int i = 0; i < desc_.inputs_size(); ++i) { + const proto::OpDesc::Var &var = desc_.inputs(i); + std::vector &args = inputs_[var.parameter()]; + int arg_size = var.arguments_size(); + for (int j = 0; j < arg_size; ++j) { + args.push_back(var.arguments(j)); } - - for (int i = 0; i < desc_.outputs_size(); ++i) { - const proto::OpDesc::Var &var = desc_.outputs(i); - std::vector &args = outputs_[var.parameter()]; - int arg_size = var.arguments_size(); - for (int j = 0; j < arg_size; ++j) { - args.push_back(var.arguments(j)); - } + } + + for (int i = 0; i < desc_.outputs_size(); ++i) { + const proto::OpDesc::Var &var = desc_.outputs(i); + std::vector &args = outputs_[var.parameter()]; + int arg_size = var.arguments_size(); + for (int j = 0; j < arg_size; ++j) { + args.push_back(var.arguments(j)); } - - for (const proto::OpDesc::Attr &attr : desc_.attrs()) { - std::string attr_name = attr.name(); - if (attr.type() != proto::AttrType::BLOCK) { - attrs_[attr_name] = Attribute::GetAttrValue(attr); - // if (attr.type() == proto::AttrType::INT){ - // std::cout << " attrName " << attr_name << " " << - // attrs_[attr_name].Get() << std::endl; - // } - } + } + + for (const proto::OpDesc::Attr &attr : desc_.attrs()) { + std::string attr_name = attr.name(); + if (attr.type() != proto::AttrType::BLOCK) { + attrs_[attr_name] = Attribute::GetAttrValue(attr); + // if (attr.type() == proto::AttrType::INT){ + // std::cout << " attrName " << attr_name << " " << + // attrs_[attr_name].Get() << std::endl; + // } } + } } const std::vector &OpDesc::Input(const std::string &name) const { - return inputs_.find(name)->second; + return inputs_.find(name)->second; } const std::vector &OpDesc::Output(const std::string &name) const { - return outputs_.find(name)->second; + return outputs_.find(name)->second; } Attribute OpDesc::GetAttr(const std::string &name) const { - auto it = attrs_.find(name); - return it->second; + auto it = attrs_.find(name); + return it->second; } const std::unordered_map &OpDesc::GetAttrMap() const { - return attrs_; + return attrs_; } } // namespace framework diff --git a/src/framework/op_desc.h b/src/framework/op_desc.h index 54cf01d6762a3bece6ad2c9fa8fcb262e6a1f30b..61fe4c99899ba9d3f1c29e660a992fa443ab2163 100644 --- a/src/framework/op_desc.h +++ b/src/framework/op_desc.h @@ -26,25 +26,25 @@ namespace paddle_mobile { namespace framework { class OpDesc : PaddleMobileObject { - public: - OpDesc(const proto::OpDesc &desc); - const std::vector &Input(const std::string &name) const; - const std::vector &Output(const std::string &name) const; - Attribute GetAttr(const std::string &name) const; +public: + OpDesc(const proto::OpDesc &desc); + const std::vector &Input(const std::string &name) const; + const std::vector &Output(const std::string &name) const; + Attribute GetAttr(const std::string &name) const; - const VariableNameMap &GetInputs() { return inputs_; } + const VariableNameMap &GetInputs() { return inputs_; } - const VariableNameMap &GetOutputs() { return outputs_; } + const VariableNameMap &GetOutputs() { return outputs_; } - const AttributeMap &GetAttrMap() const; + const AttributeMap &GetAttrMap() const; - const std::string &Type() { return desc_.type(); }; + const std::string &Type() { return desc_.type(); }; - private: - proto::OpDesc desc_; - VariableNameMap inputs_; - VariableNameMap outputs_; - AttributeMap attrs_; +private: + proto::OpDesc desc_; + VariableNameMap inputs_; + VariableNameMap outputs_; + AttributeMap attrs_; }; } // namespace framework diff --git a/src/framework/op_info.h b/src/framework/op_info.h index 37702327862d6612701b17b8cd97c2674f4c3963..69c99a8ed2097a143f6a56c7d5ad6f94d9ade40c 100644 --- a/src/framework/op_info.h +++ b/src/framework/op_info.h @@ -25,13 +25,13 @@ namespace paddle_mobile { namespace framework { template struct OpInfo { - OpCreator creator_; - const OpCreator &Creator() const { - // PADDLE_ENFORCE_NOT_NULL(creator_, - // "Operator Creator has not been - // registered"); - return creator_; - } + OpCreator creator_; + const OpCreator &Creator() const { + // PADDLE_ENFORCE_NOT_NULL(creator_, + // "Operator Creator has not been + // registered"); + return creator_; + } }; template class OpInfoMap; @@ -39,55 +39,55 @@ template class OpInfoMap; template static OpInfoMap *g_op_info_map = nullptr; template class OpInfoMap { - public: - static OpInfoMap &Instance() { - if (g_op_info_map == nullptr) { - g_op_info_map = new OpInfoMap(); - } - return *g_op_info_map; - }; - - bool Has(const std::string &op_type) const { - return map_.find(op_type) != map_.end(); - } - - void Insert(const std::string &type, const OpInfo &info) { - // PADDLE_ENFORCE(!Has(type), "Operator %s has been - // registered", type); - map_.insert({type, info}); - } - - const OpInfo &Get(const std::string &type) const { - auto op_info_ptr = GetNullable(type); - // PADDLE_ENFORCE_NOT_NULL(op_info_ptr, "Operator %s has not - // been - // registered", - // type); - return *op_info_ptr; +public: + static OpInfoMap &Instance() { + if (g_op_info_map == nullptr) { + g_op_info_map = new OpInfoMap(); } - - const OpInfo *GetNullable(const std::string &type) const { - auto it = map_.find(type); - if (it == map_.end()) { - return nullptr; - } else { - return &it->second; - } + return *g_op_info_map; + }; + + bool Has(const std::string &op_type) const { + return map_.find(op_type) != map_.end(); + } + + void Insert(const std::string &type, const OpInfo &info) { + // PADDLE_ENFORCE(!Has(type), "Operator %s has been + // registered", type); + map_.insert({type, info}); + } + + const OpInfo &Get(const std::string &type) const { + auto op_info_ptr = GetNullable(type); + // PADDLE_ENFORCE_NOT_NULL(op_info_ptr, "Operator %s has not + // been + // registered", + // type); + return *op_info_ptr; + } + + const OpInfo *GetNullable(const std::string &type) const { + auto it = map_.find(type); + if (it == map_.end()) { + return nullptr; + } else { + return &it->second; } + } - const std::unordered_map> &map() const { - return map_; - } + const std::unordered_map> &map() const { + return map_; + } - std::unordered_map> *mutable_map() { - return &map_; - } + std::unordered_map> *mutable_map() { + return &map_; + } - private: - OpInfoMap() = default; - std::unordered_map> map_; +private: + OpInfoMap() = default; + std::unordered_map> map_; - // DISABLE_COPY_AND_ASSIGN(OpInfoMap); + // DISABLE_COPY_AND_ASSIGN(OpInfoMap); }; } // namespace framework diff --git a/src/framework/op_kernel_type.h b/src/framework/op_kernel_type.h index f4244b1241ba4ac87c3d46255f0bfc1f06a40021..67aa0d7ad9eab550568e5a92f557b3551afe0721 100644 --- a/src/framework/op_kernel_type.h +++ b/src/framework/op_kernel_type.h @@ -24,41 +24,40 @@ SOFTWARE. namespace paddle_mobile { namespace framework { struct OpKernelType { - struct Hash { - size_t operator()(const OpKernelType &key) const { - int data_type = static_cast(key.data_type_) << LEFT_SHIFT; - int data_layout = static_cast(key.data_layout_) - << (LEFT_SHIFT * 2); + struct Hash { + size_t operator()(const OpKernelType &key) const { + int data_type = static_cast(key.data_type_) << LEFT_SHIFT; + int data_layout = static_cast(key.data_layout_) << (LEFT_SHIFT * 2); - std::hash hasher; - return hasher(data_type + data_layout); - } - }; + std::hash hasher; + return hasher(data_type + data_layout); + } + }; - // place, data_type, library_type kinds less than 2^8 - constexpr static int LEFT_SHIFT = 8; + // place, data_type, library_type kinds less than 2^8 + constexpr static int LEFT_SHIFT = 8; - proto::VarType::Type data_type_; - DataLayout data_layout_; + proto::VarType::Type data_type_; + DataLayout data_layout_; - OpKernelType(proto::VarType::Type data_type, - DataLayout data_layout = DataLayout::kAnyLayout) - : data_type_(data_type), data_layout_(data_layout) {} + OpKernelType(proto::VarType::Type data_type, + DataLayout data_layout = DataLayout::kAnyLayout) + : data_type_(data_type), data_layout_(data_layout) {} - bool operator==(const OpKernelType &o) const { - return data_type_ == o.data_type_ && data_layout_ == o.data_layout_; - } + bool operator==(const OpKernelType &o) const { + return data_type_ == o.data_type_ && data_layout_ == o.data_layout_; + } - bool operator!=(const OpKernelType &o) const { return !(*this == o); } + bool operator!=(const OpKernelType &o) const { return !(*this == o); } }; inline bool NeedTransformLayout(const DataLayout &l, const DataLayout &r) { - return l != DataLayout::kAnyLayout && r != DataLayout::kAnyLayout && l != r; + return l != DataLayout::kAnyLayout && r != DataLayout::kAnyLayout && l != r; } inline bool TransFromNeeded(const OpKernelType &l, const OpKernelType &r) { - return (l.data_type_ != r.data_type_) || - NeedTransformLayout(l.data_layout_, r.data_layout_); + return (l.data_type_ != r.data_type_) || + NeedTransformLayout(l.data_layout_, r.data_layout_); } } // namespace framework diff --git a/src/framework/operator.cpp b/src/framework/operator.cpp index d7559dafe3197abcf9b6e0fa4bc3e88eda34680d..17a2b48150238391396913c3ad9bb9c1c782b6c0 100644 --- a/src/framework/operator.cpp +++ b/src/framework/operator.cpp @@ -30,7 +30,7 @@ OperatorBase::OperatorBase(const std::string &type, std::shared_ptr scope) : type_(type), inputs_(inputs), outputs_(outputs), attrs_(attrs), scope_(scope) { - CheckAllInputOutputSet(); + CheckAllInputOutputSet(); } template void OperatorBase::CheckAllInputOutputSet() const {} diff --git a/src/framework/operator.h b/src/framework/operator.h index 734b746d2a4386c407a06f4dc6daa77d8229f026..b3306d284888c73d4bf0ca53b5355abebeb5b2c5 100644 --- a/src/framework/operator.h +++ b/src/framework/operator.h @@ -49,50 +49,50 @@ static std::unordered_map< {"fetch", {{"X"}, {"Out"}}}}; template class OperatorBase : PaddleMobileObject { - public: - OperatorBase(const std::string &type, const VariableNameMap &inputs, - const VariableNameMap &outputs, const AttributeMap &attrs, - std::shared_ptr scope); - virtual ~OperatorBase() {} - virtual void Run() const = 0; +public: + OperatorBase(const std::string &type, const VariableNameMap &inputs, + const VariableNameMap &outputs, const AttributeMap &attrs, + std::shared_ptr scope); + virtual ~OperatorBase() {} + virtual void Run() const = 0; - const VariableNameMap &Inputs() const { return inputs_; } - const VariableNameMap &Outputs() const { return outputs_; } - const std::string &Type() const { return type_; } - const AttributeMap &Attrs() const { return attrs_; } - void ClearVariables(const std::vector &var_names) const { - if (this->scope_) { - this->scope_->EraseVars(var_names); - } + const VariableNameMap &Inputs() const { return inputs_; } + const VariableNameMap &Outputs() const { return outputs_; } + const std::string &Type() const { return type_; } + const AttributeMap &Attrs() const { return attrs_; } + void ClearVariables(const std::vector &var_names) const { + if (this->scope_) { + this->scope_->EraseVars(var_names); } + } - protected: - std::shared_ptr scope_; - std::string type_; - VariableNameMap inputs_; - VariableNameMap outputs_; - AttributeMap attrs_; +protected: + std::shared_ptr scope_; + std::string type_; + VariableNameMap inputs_; + VariableNameMap outputs_; + AttributeMap attrs_; - private: - void CheckAllInputOutputSet() const; +private: + void CheckAllInputOutputSet() const; }; template class OperatorWithKernel : public OperatorBase { - public: - OperatorWithKernel(const std::string &type, const VariableNameMap &inputs, - const VariableNameMap &outputs, - const AttributeMap &attrs, std::shared_ptr scope) - : OperatorBase(type, inputs, outputs, attrs, scope) {} - virtual void InferShape() const = 0; - virtual void Run() const = 0; +public: + OperatorWithKernel(const std::string &type, const VariableNameMap &inputs, + const VariableNameMap &outputs, const AttributeMap &attrs, + std::shared_ptr scope) + : OperatorBase(type, inputs, outputs, attrs, scope) {} + virtual void InferShape() const = 0; + virtual void Run() const = 0; }; template class OpKernelBase : PaddleMobileObject { - public: - virtual void Compute(const P ¶) const = 0; +public: + virtual void Compute(const P ¶) const = 0; - virtual ~OpKernelBase() = default; + virtual ~OpKernelBase() = default; }; } // namespace framework diff --git a/src/framework/paddle_mobile_object.h b/src/framework/paddle_mobile_object.h index 4fae3ce8df2a718447f3fb966f987fc6490915c8..2dbd31abc9dcc61201dc57f36e1efb0f859e19d2 100644 --- a/src/framework/paddle_mobile_object.h +++ b/src/framework/paddle_mobile_object.h @@ -24,13 +24,13 @@ SOFTWARE. namespace paddle_mobile { class PaddleMobileObject { - public: - virtual std::string ToString() { - char address[128] = {0}; - sprintf(address, "%p", this); - return std::string(address); - } +public: + virtual std::string ToString() { + char address[128] = {0}; + sprintf(address, "%p", this); + return std::string(address); + } - private: +private: }; } // namespace paddle_mobile diff --git a/src/framework/program-optimize/node.cpp b/src/framework/program-optimize/node.cpp index a7993646f1ea0b6acca73d19d92cbd76aaa00253..63faaac255857bd2b5b022ecb9e6b2f41df1fdfe 100644 --- a/src/framework/program-optimize/node.cpp +++ b/src/framework/program-optimize/node.cpp @@ -25,71 +25,71 @@ namespace paddle_mobile { namespace framework { Node &Node::operator>(std::shared_ptr node) { - outputs_.push_back(node); - std::shared_ptr this_node; - node->inputs_.push_back(this); - return *node; + outputs_.push_back(node); + std::shared_ptr this_node; + node->inputs_.push_back(this); + return *node; } bool Node::operator==(const Node &in) { - if (in.type_ == this->type_) { - if (this->outputs_.size() == in.outputs_.size()) { - for (int i = 0; i < outputs_.size(); ++i) { - if (!(*outputs_[i] == *in.outputs_[i])) { - return false; - } - } - } else { - return false; + if (in.type_ == this->type_) { + if (this->outputs_.size() == in.outputs_.size()) { + for (int i = 0; i < outputs_.size(); ++i) { + if (!(*outputs_[i] == *in.outputs_[i])) { + return false; } + } } else { - return false; + return false; } - return true; + } else { + return false; + } + return true; } std::string Node::ToString(std::string blank, const Node *node) const { - std::stringstream ss; - ss << type_ << "-> \n"; + std::stringstream ss; + ss << type_ << "-> \n"; - if (inputs_.size() > 1 && node != inputs_.back()) { - return ss.str(); - } else if (inputs_.size() > 1 && node == inputs_.back()) { - ss << "\n" << blank << type_ << "\n"; - } - - for (int i = 0; i < outputs_.size(); ++i) { - ss << blank << outputs_[i]->ToString(blank + " ", this) << ""; - } + if (inputs_.size() > 1 && node != inputs_.back()) { return ss.str(); + } else if (inputs_.size() > 1 && node == inputs_.back()) { + ss << "\n" << blank << type_ << "\n"; + } + + for (int i = 0; i < outputs_.size(); ++i) { + ss << blank << outputs_[i]->ToString(blank + " ", this) << ""; + } + return ss.str(); } std::string Node::ToString() const { return this->ToString(" ", this); } Node &Node::To(int index) { - if (index == 0) { - this->outputs_.clear(); - } + if (index == 0) { + this->outputs_.clear(); + } - for (int j = 0; j < this->outputs_.size(); ++j) { - outputs_[j]->To(index - 1); - } - return *this; + for (int j = 0; j < this->outputs_.size(); ++j) { + outputs_[j]->To(index - 1); + } + return *this; } uint Node::depth(uint begin) { - uint depth = 0; - begin++; - for (int i = 0; i < outputs_.size(); ++i) { - uint output_depth = outputs_[i]->depth(begin); - depth = output_depth > depth ? output_depth : depth; - } - return begin > depth ? begin : depth; + uint depth = 0; + begin++; + for (int i = 0; i < outputs_.size(); ++i) { + uint output_depth = outputs_[i]->depth(begin); + depth = output_depth > depth ? output_depth : depth; + } + return begin > depth ? begin : depth; } Print &operator<<(Print &printer, const Node &node) { - printer << node.ToString(); - return printer; + printer << node.ToString(); + return printer; } } // namespace framework diff --git a/src/framework/program-optimize/node.h b/src/framework/program-optimize/node.h index d538a0832b065545ed0dc6ec6eebff27930f3a99..e241e81efdd1d7098d170557cc5ec5693908386e 100644 --- a/src/framework/program-optimize/node.h +++ b/src/framework/program-optimize/node.h @@ -29,22 +29,22 @@ namespace paddle_mobile { namespace framework { class Node : PaddleMobileObject { - public: - Node(const std::string &type) : type_(type) {} - Node(std::shared_ptr op_desc) - : op_desc_(op_desc), type_(op_desc->Type()){}; - Node &operator>(std::shared_ptr node); - bool operator==(const Node &in); - std::string ToString() const; - Node &To(int index); - uint depth(uint begin = 0); +public: + Node(const std::string &type) : type_(type) {} + Node(std::shared_ptr op_desc) + : op_desc_(op_desc), type_(op_desc->Type()){}; + Node &operator>(std::shared_ptr node); + bool operator==(const Node &in); + std::string ToString() const; + Node &To(int index); + uint depth(uint begin = 0); - private: - std::shared_ptr op_desc_; - std::string ToString(std::string blank, const Node *node) const; - std::vector> outputs_; - std::vector inputs_; - std::string type_; +private: + std::shared_ptr op_desc_; + std::string ToString(std::string blank, const Node *node) const; + std::vector> outputs_; + std::vector inputs_; + std::string type_; }; Print &operator<<(Print &printer, const Node &node); diff --git a/src/framework/program-optimize/program_optimize.cpp b/src/framework/program-optimize/program_optimize.cpp index 51c3e36057d825afaae8ba8ef5d3ce938444998f..e8fe3a690a7c68af579905f9117a1a85d3621bda 100644 --- a/src/framework/program-optimize/program_optimize.cpp +++ b/src/framework/program-optimize/program_optimize.cpp @@ -26,49 +26,48 @@ std::shared_ptr ProgramOptimize::Optimize() {} std::shared_ptr ProgramOptimize::FushionOptimize(std::shared_ptr ori_des) { - for (int i = 0; i < ori_des->Blocks().size(); ++i) { - std::unordered_map> output_nodes; - std::shared_ptr begin_node; - auto block = ori_des->Block(i); - // DLOG << " ops size: " << block->Ops().size(); - for (int j = 0; j < block->Ops().size(); ++j) { - auto op = block->Ops()[j]; - auto op_type = op->Type(); - // DLOG << "op type: " << op_type << " index: " << j; - if (op_input_output_key.find(op->Type()) == - op_input_output_key.end()) { - return NULL; - } + for (int i = 0; i < ori_des->Blocks().size(); ++i) { + std::unordered_map> output_nodes; + std::shared_ptr begin_node; + auto block = ori_des->Block(i); + // DLOG << " ops size: " << block->Ops().size(); + for (int j = 0; j < block->Ops().size(); ++j) { + auto op = block->Ops()[j]; + auto op_type = op->Type(); + // DLOG << "op type: " << op_type << " index: " << j; + if (op_input_output_key.find(op->Type()) == op_input_output_key.end()) { + return NULL; + } - std::shared_ptr node = std::make_shared(op); - if (j == 0) { - begin_node = node; - } + std::shared_ptr node = std::make_shared(op); + if (j == 0) { + begin_node = node; + } - auto input_keys = op_input_output_key.at(op->Type()).first; - for (auto input_key : input_keys) { - auto op_inputs = op->Input(input_key); - for (int l = 0; l < op_inputs.size(); ++l) { - std::string input_key = op_inputs[l]; - if (output_nodes.find(input_key) != output_nodes.end()) { - auto input_node = output_nodes[input_key]; - *input_node > node; - } - } - } - - auto output_keys = op_input_output_key.at(op_type).second; - for (auto output_key : output_keys) { - auto op_outputs = op->Output(output_key); - for (int k = 0; k < op_outputs.size(); ++k) { - output_nodes[op_outputs[k]] = node; - } - } + auto input_keys = op_input_output_key.at(op->Type()).first; + for (auto input_key : input_keys) { + auto op_inputs = op->Input(input_key); + for (int l = 0; l < op_inputs.size(); ++l) { + std::string input_key = op_inputs[l]; + if (output_nodes.find(input_key) != output_nodes.end()) { + auto input_node = output_nodes[input_key]; + *input_node > node; + } } + } - DLOG << "node: \n" << *begin_node; + auto output_keys = op_input_output_key.at(op_type).second; + for (auto output_key : output_keys) { + auto op_outputs = op->Output(output_key); + for (int k = 0; k < op_outputs.size(); ++k) { + output_nodes[op_outputs[k]] = node; + } + } } - return ori_des; + + DLOG << "node: \n" << *begin_node; + } + return ori_des; } } // namespace framework } // namespace paddle_mobile diff --git a/src/framework/program-optimize/program_optimize.h b/src/framework/program-optimize/program_optimize.h index f3655da8b3dd78c59a81b9407850b175d10f1fdc..be4e933cda056e81286be861f297357abe61d542 100644 --- a/src/framework/program-optimize/program_optimize.h +++ b/src/framework/program-optimize/program_optimize.h @@ -26,16 +26,16 @@ namespace paddle_mobile { namespace framework { class ProgramOptimize { - public: - ProgramOptimize() {} - std::shared_ptr Optimize(); - std::shared_ptr - FushionOptimize(std::shared_ptr ori_des); +public: + ProgramOptimize() {} + std::shared_ptr Optimize(); + std::shared_ptr + FushionOptimize(std::shared_ptr ori_des); - private: - // std::shared_ptr ori_desc_; - std::vector>> - outputs_nodes_; +private: + // std::shared_ptr ori_desc_; + std::vector>> + outputs_nodes_; }; } // namespace framework } // namespace paddle_mobile diff --git a/src/framework/program.h b/src/framework/program.h index b3df56e01e543761e24d897ad81857f13def4d32..8844757e2140e045fef8f6a889b501be659a3280 100644 --- a/src/framework/program.h +++ b/src/framework/program.h @@ -28,12 +28,12 @@ namespace framework { template class Program : PaddleMobileObject { - public: - std::shared_ptr originProgram; - std::shared_ptr optimizeProgram; - std::shared_ptr scope; +public: + std::shared_ptr originProgram; + std::shared_ptr optimizeProgram; + std::shared_ptr scope; - private: +private: }; } // namespace framework diff --git a/src/framework/program_desc.cpp b/src/framework/program_desc.cpp index 718ae5791c837320f1573d61b2f8de8550d45eb6..a6a9d30a69c515ef7754b7422bfbe916257a8d8d 100644 --- a/src/framework/program_desc.cpp +++ b/src/framework/program_desc.cpp @@ -8,14 +8,14 @@ namespace paddle_mobile { namespace framework { ProgramDesc::ProgramDesc(const proto::ProgramDesc &desc) : desc_(desc) { - for (auto &block_desc : *desc_.mutable_blocks()) { - // new framework::BlockDesc(block_desc) - blocks_.emplace_back(std::make_shared(block_desc)); - } + for (auto &block_desc : *desc_.mutable_blocks()) { + // new framework::BlockDesc(block_desc) + blocks_.emplace_back(std::make_shared(block_desc)); + } } std::shared_ptr ProgramDesc::Block(size_t idx) { - return blocks_[idx]; + return blocks_[idx]; } } // namespace framework diff --git a/src/framework/program_desc.h b/src/framework/program_desc.h index b65ba3fea8381d25aadb6db2881ee82d7b5ce4ca..a86d403c707c25ff1dbb9d3b048ce338338084de 100644 --- a/src/framework/program_desc.h +++ b/src/framework/program_desc.h @@ -28,14 +28,14 @@ namespace paddle_mobile { namespace framework { class ProgramDesc : PaddleMobileObject { - public: - ProgramDesc(const proto::ProgramDesc &desc); - std::shared_ptr Block(size_t idx); - const std::vector> &Blocks() { return blocks_; }; +public: + ProgramDesc(const proto::ProgramDesc &desc); + std::shared_ptr Block(size_t idx); + const std::vector> &Blocks() { return blocks_; }; - private: - std::vector> blocks_; - proto::ProgramDesc desc_; +private: + std::vector> blocks_; + proto::ProgramDesc desc_; }; } // namespace framework diff --git a/src/framework/scope.cc b/src/framework/scope.cc index c270921258e7a583be32fd4efdc5010bc835486a..490c37a088c6d33ab8450199686b2607fee28311 100644 --- a/src/framework/scope.cc +++ b/src/framework/scope.cc @@ -7,20 +7,20 @@ namespace paddle_mobile { namespace framework { Scope &Scope::NewScope() const { - std::unique_lock lock(mutex_); - kids_.push_back(new Scope(this)); - return *kids_.back(); + std::unique_lock lock(mutex_); + kids_.push_back(new Scope(this)); + return *kids_.back(); } Variable *Scope::Var(const std::string &name) { - auto *pvar = FindVarLocally(name); - if (pvar != nullptr) { - return pvar; - }; - pvar = new Variable; - vars_[name] = pvar; - pvar->name_ = &(vars_.find(name)->first); + auto *pvar = FindVarLocally(name); + if (pvar != nullptr) { return pvar; + }; + pvar = new Variable; + vars_[name] = pvar; + pvar->name_ = &(vars_.find(name)->first); + return pvar; } // Variable* Scope::Var(std::string* name) { @@ -33,70 +33,70 @@ Variable *Scope::Var(const std::string &name) { // } Variable *Scope::FindVar(const std::string &name) const { - auto *pvar = FindVarLocally(name); - if (pvar != nullptr) { - return pvar; - } - return (parent_ == nullptr) ? nullptr : parent_->FindVar(name); + auto *pvar = FindVarLocally(name); + if (pvar != nullptr) { + return pvar; + } + return (parent_ == nullptr) ? nullptr : parent_->FindVar(name); } const Scope *Scope::FindScope(const Variable *var) const { - for (auto &name_var : vars_) { - if (name_var.second == var) { - return this; - } + for (auto &name_var : vars_) { + if (name_var.second == var) { + return this; } - return (parent_ == nullptr) ? nullptr : parent_->FindScope(var); + } + return (parent_ == nullptr) ? nullptr : parent_->FindScope(var); } void Scope::DropKids() { - for (Scope *s : kids_) { - delete s; - } - kids_.clear(); + for (Scope *s : kids_) { + delete s; + } + kids_.clear(); } std::vector Scope::LocalVarNames() const { - std::vector known_vars; - known_vars.reserve(vars_.size()); - for (auto &name_var : vars_) { - known_vars.emplace_back(name_var.first); - } - return known_vars; + std::vector known_vars; + known_vars.reserve(vars_.size()); + for (auto &name_var : vars_) { + known_vars.emplace_back(name_var.first); + } + return known_vars; } void Scope::DeleteScope(Scope *scope) const { - std::unique_lock lock(mutex_); - auto it = std::find(kids_.begin(), kids_.end(), scope); - kids_.erase(it); - delete scope; - // deferent + std::unique_lock lock(mutex_); + auto it = std::find(kids_.begin(), kids_.end(), scope); + kids_.erase(it); + delete scope; + // deferent } void Scope::EraseVars(const std::vector &var_names) { - std::set var_set(var_names.begin(), var_names.end()); - for (auto it = vars_.begin(); it != vars_.end();) { - if (var_set.find(it->first) != var_set.end()) { - delete it->second; - it = vars_.erase(it); - } else { - ++it; - } + std::set var_set(var_names.begin(), var_names.end()); + for (auto it = vars_.begin(); it != vars_.end();) { + if (var_set.find(it->first) != var_set.end()) { + delete it->second; + it = vars_.erase(it); + } else { + ++it; } + } } void Scope::Rename(const std::string &origin_name, const std::string &new_name) const { - auto origin_it = vars_.find(origin_name); - if (origin_it == vars_.end()) { - return; - } - auto new_it = vars_.find(new_name); - if (new_it != vars_.end()) { - return; - } - vars_[new_name] = origin_it->second; - vars_.erase(origin_it); + auto origin_it = vars_.find(origin_name); + if (origin_it == vars_.end()) { + return; + } + auto new_it = vars_.find(new_name); + if (new_it != vars_.end()) { + return; + } + vars_[new_name] = origin_it->second; + vars_.erase(origin_it); } // // std::string Scope::Rename(const std::string& origin_name) @@ -108,11 +108,11 @@ void Scope::Rename(const std::string &origin_name, // } Variable *Scope::FindVarLocally(const std::string &name) const { - auto it = vars_.find(name); - if (it != vars_.end()) { - return it->second; - } - return nullptr; + auto it = vars_.find(name); + if (it != vars_.end()) { + return it->second; + } + return nullptr; } } // namespace framework diff --git a/src/framework/scope.h b/src/framework/scope.h index 7913c56c805941b40469cbc70cc390716d39cb7f..8b0e074ade7e13ce76fc57b741c4a1cca914e3b4 100644 --- a/src/framework/scope.h +++ b/src/framework/scope.h @@ -26,56 +26,56 @@ SOFTWARE. namespace paddle_mobile { namespace framework { class Scope { - public: - Scope() {} - ~Scope() {} +public: + Scope() {} + ~Scope() {} - Scope &NewScope() const; + Scope &NewScope() const; - /// Create a variable with given name if it doesn't exist. - Variable *Var(const std::string &name); + /// Create a variable with given name if it doesn't exist. + Variable *Var(const std::string &name); - /// Create a variable with a scope-unique name. - Variable *Var(std::string *name = nullptr); + /// Create a variable with a scope-unique name. + Variable *Var(std::string *name = nullptr); - void EraseVars(const std::vector &var_names); + void EraseVars(const std::vector &var_names); - /// Find a variable in the scope or any of its ancestors. Returns - /// nullptr if cannot find. - Variable *FindVar(const std::string &name) const; + /// Find a variable in the scope or any of its ancestors. Returns + /// nullptr if cannot find. + Variable *FindVar(const std::string &name) const; - const Scope *parent() const { return parent_; } + const Scope *parent() const { return parent_; } - /// Find the scope or an ancestor scope that contains the given - /// variable. - const Scope *FindScope(const Variable *var) const; + /// Find the scope or an ancestor scope that contains the given + /// variable. + const Scope *FindScope(const Variable *var) const; - void DeleteScope(Scope *scope) const; + void DeleteScope(Scope *scope) const; - /// Drop all kids scopes belonged to this scope. - void DropKids(); + /// Drop all kids scopes belonged to this scope. + void DropKids(); - // enumerate all the variables current contains. - std::vector LocalVarNames() const; + // enumerate all the variables current contains. + std::vector LocalVarNames() const; - // Rename variable to a new name - void Rename(const std::string &origin_name, - const std::string &new_name) const; + // Rename variable to a new name + void Rename(const std::string &origin_name, + const std::string &new_name) const; - // Rename variable to a new name and return the new name - std::string Rename(const std::string &origin_name) const; + // Rename variable to a new name and return the new name + std::string Rename(const std::string &origin_name) const; - Variable *FindVarLocally(const std::string &name) const; + Variable *FindVarLocally(const std::string &name) const; - private: - // Call Scope::NewScope for a sub-scope. - explicit Scope(Scope const *parent) : parent_(parent) {} +private: + // Call Scope::NewScope for a sub-scope. + explicit Scope(Scope const *parent) : parent_(parent) {} - mutable std::unordered_map vars_; - mutable std::list kids_; - Scope const *parent_{nullptr}; + mutable std::unordered_map vars_; + mutable std::list kids_; + Scope const *parent_{nullptr}; - mutable std::mutex mutex_; + mutable std::mutex mutex_; }; } // namespace framework } // namespace paddle_mobile diff --git a/src/framework/selected_rows.h b/src/framework/selected_rows.h index 66a49bb0617e36bd3889fbb2bb11796b344dbeb8..b4e2dcb972c192dda1b07bf8dd245d50c7f7d2b6 100644 --- a/src/framework/selected_rows.h +++ b/src/framework/selected_rows.h @@ -27,54 +27,54 @@ namespace paddle_mobile { namespace framework { class SelectedRows { - public: - SelectedRows(const std::vector &rows, const int64_t &height) - : rows_(rows), height_(height) { - value_.reset(new Tensor()); - } - - SelectedRows() { - height_ = 0; - value_.reset(new Tensor()); - } - - const Tensor &value() const { return *value_; } - - Tensor *mutable_value() { return value_.get(); } - - int64_t height() const { return height_; } - - void set_height(int64_t height) { height_ = height; } - - const std::vector &rows() const { return rows_; } - - std::vector *mutable_rows() { return &rows_; } - - void set_rows(const std::vector &rows) { rows_ = rows; } - - /** - * get the index of id in rows - */ - int64_t index(int64_t id) const { - auto it = std::find(rows_.begin(), rows_.end(), id); - // PADDLE_ENFORCE(it != rows_.end(), "id should be in rows"); - return static_cast(std::distance(rows_.begin(), it)); - } - - DDim GetCompleteDims() const { - std::vector dims = vectorize(value_->dims()); - dims[0] = height_; - return make_ddim(dims); - } - - private: - // Notice: rows can be duplicate. We can have {0, 4, 7, 0, 5, 7, 9} - // here. - // SelectedRows are simply concated when adding together. Until a - // SelectedRows add a Tensor, will the duplicate rows be handled. - std::vector rows_; - std::unique_ptr value_{nullptr}; - int64_t height_; +public: + SelectedRows(const std::vector &rows, const int64_t &height) + : rows_(rows), height_(height) { + value_.reset(new Tensor()); + } + + SelectedRows() { + height_ = 0; + value_.reset(new Tensor()); + } + + const Tensor &value() const { return *value_; } + + Tensor *mutable_value() { return value_.get(); } + + int64_t height() const { return height_; } + + void set_height(int64_t height) { height_ = height; } + + const std::vector &rows() const { return rows_; } + + std::vector *mutable_rows() { return &rows_; } + + void set_rows(const std::vector &rows) { rows_ = rows; } + + /** + * get the index of id in rows + */ + int64_t index(int64_t id) const { + auto it = std::find(rows_.begin(), rows_.end(), id); + // PADDLE_ENFORCE(it != rows_.end(), "id should be in rows"); + return static_cast(std::distance(rows_.begin(), it)); + } + + DDim GetCompleteDims() const { + std::vector dims = vectorize(value_->dims()); + dims[0] = height_; + return make_ddim(dims); + } + +private: + // Notice: rows can be duplicate. We can have {0, 4, 7, 0, 5, 7, 9} + // here. + // SelectedRows are simply concated when adding together. Until a + // SelectedRows add a Tensor, will the duplicate rows be handled. + std::vector rows_; + std::unique_ptr value_{nullptr}; + int64_t height_; }; } // namespace framework diff --git a/src/framework/tensor.h b/src/framework/tensor.h index 3ecfbf8ec8699783c50cf9437ce9f5d90023abdd..8f0374c3bbcdd48ed5fe70daa5f65cc1680d01a5 100644 --- a/src/framework/tensor.h +++ b/src/framework/tensor.h @@ -29,305 +29,304 @@ namespace framework { template struct SizeOfTypeFunctor; template struct SizeOfTypeFunctor { - size_t operator()(std::type_index type) const { - if (typeid(T).hash_code() == type.hash_code()) { - return sizeof(T); - } else { - return 0UL; - } + size_t operator()(std::type_index type) const { + if (typeid(T).hash_code() == type.hash_code()) { + return sizeof(T); + } else { + return 0UL; } + } }; template <> struct SizeOfTypeFunctor<> { - size_t operator()(std::type_index type) const { return 0UL; } + size_t operator()(std::type_index type) const { return 0UL; } }; template struct SizeOfTypeFunctor { - size_t operator()(std::type_index type) const { - SizeOfTypeFunctor head; - size_t head_size = head(type); - if (head_size != 0) { - return head_size; - } - SizeOfTypeFunctor tail; - return tail(type); + size_t operator()(std::type_index type) const { + SizeOfTypeFunctor head; + size_t head_size = head(type); + if (head_size != 0) { + return head_size; } + SizeOfTypeFunctor tail; + return tail(type); + } }; static inline size_t SizeOfType(std::type_index type) { - SizeOfTypeFunctor - functor; - size_t size = functor(type); - // PADDLE_ENFORCE(size != 0UL, "Cannot get size of type %s", - // type.name()); - return size; + SizeOfTypeFunctor functor; + size_t size = functor(type); + // PADDLE_ENFORCE(size != 0UL, "Cannot get size of type %s", + // type.name()); + return size; } class LoDTensor; class Tensor { - public: - Tensor() : offset_(0) {} - - /*! Return a pointer to mutable memory block. */ - template inline T *data() { - check_memory_size(); - // PADDLE_ENFORCE(std::is_same::value || - // holder_->type().hash_code() == - // typeid(T).hash_code(), - // "Tensor holds the wrong type, it holds %s", - // this->holder_->type().name()); - return reinterpret_cast( - reinterpret_cast(holder_->ptr()) + offset_); +public: + Tensor() : offset_(0) {} + + /*! Return a pointer to mutable memory block. */ + template inline T *data() { + check_memory_size(); + // PADDLE_ENFORCE(std::is_same::value || + // holder_->type().hash_code() == + // typeid(T).hash_code(), + // "Tensor holds the wrong type, it holds %s", + // this->holder_->type().name()); + return reinterpret_cast(reinterpret_cast(holder_->ptr()) + + offset_); + } + + /*! Return a pointer to constant memory block. */ + template inline const T *data() const { + check_memory_size(); + // PADDLE_ENFORCE(std::is_same::value || + // holder_->type().hash_code() == + // typeid(T).hash_code(), + // "Tensor holds the wrong type, it holds %s", + // this->holder_->type().name()); + + return reinterpret_cast( + reinterpret_cast(holder_->ptr()) + offset_); + } + + inline bool IsInitialized() const { return holder_ != nullptr; } + + /** + * @brief Return a pointer to mutable memory block. + * @note If not exist, then allocation. + */ + template inline T *mutable_data() { + static_assert(std::is_pod::value, "T must be POD"); + return reinterpret_cast(mutable_data(typeid(T))); + } + + inline void *mutable_data(std::type_index type) { + if (holder_ != nullptr) { + holder_->set_type(type); } - - /*! Return a pointer to constant memory block. */ - template inline const T *data() const { - check_memory_size(); - // PADDLE_ENFORCE(std::is_same::value || - // holder_->type().hash_code() == - // typeid(T).hash_code(), - // "Tensor holds the wrong type, it holds %s", - // this->holder_->type().name()); - - return reinterpret_cast( - reinterpret_cast(holder_->ptr()) + offset_); + // PADDLE_ENFORCE_GE(numel(), 0, + // "When calling this method, the Tensor's + // numel must be + // " "equal or larger than zero. " "Please + // check + // Tensor::Resize has been called first."); + int64_t size = numel() * SizeOfType(type); + /* some versions of boost::variant don't have operator!= */ + if (holder_ == nullptr || holder_->size() < size + offset_) { + holder_.reset(new PlaceholderImpl(size, type)); + + offset_ = 0; } - - inline bool IsInitialized() const { return holder_ != nullptr; } - - /** - * @brief Return a pointer to mutable memory block. - * @note If not exist, then allocation. - */ - template inline T *mutable_data() { - static_assert(std::is_pod::value, "T must be POD"); - return reinterpret_cast(mutable_data(typeid(T))); + return reinterpret_cast( + reinterpret_cast(holder_->ptr()) + offset_); + } + + inline void *mutable_data() { + // PADDLE_ENFORCE(this->holder_ != nullptr, + // "Cannot invoke mutable data if current hold + // nothing."); + return mutable_data(holder_->type()); + } + + /** + * @brief Return a pointer to mutable memory block. + * + * @param[in] dims The dimensions of the memory block. + * @param[in] place The place of the memory block. + * + * @note If not exist, then allocation. + */ + template inline T *mutable_data(DDim dims) { + static_assert(std::is_pod::value, "T must be POD"); + Resize(dims); + return mutable_data(); + } + + /*! Return the dimensions of the memory block. */ + inline const DDim &dims() const { return dims_; } + + /*! Return the numel of the memory block. */ + inline int64_t numel() const { return product(dims_); } + + /*! Resize the dimensions of the memory block. */ + inline Tensor &Resize(const DDim &dims) { + dims_ = dims; + return *this; + } + + /*! The internal of two tensors share the same memory block. */ + inline Tensor &ShareDataWith(const Tensor &src) { + src.check_memory_size(); + *this = src; + return *this; + } + + /** + * @brief Return a sub-tensor of the given tensor. + * + * @param[in] begin_idx The index of the start row(inclusive) to + * slice. + * The index number begins from 0. + * @param[in] end_idx The index of the end row(exclusive) to + * slice. + * The index number begins from 0. + */ + inline Tensor Slice(int begin_idx, int end_idx) const { + check_memory_size(); + // PADDLE_ENFORCE_GE(begin_idx, 0, + // "The start row index must be greater than + // 0."); + // PADDLE_ENFORCE_LE(end_idx, dims_[0], "The end row index is + // out of + // bound."); PADDLE_ENFORCE_LT( + // begin_idx, end_idx, + // "The start row index must be lesser than the end row + // index."); + + if (dims_[0] == 1) { + return *this; + } else { + size_t base = numel() / dims_[0]; + Tensor dst; + dst.holder_ = holder_; + dst.set_layout(layout_); + DDim dst_dims = dims_; + dst_dims[0] = end_idx - begin_idx; + dst.Resize(dst_dims); + dst.offset_ = offset_ + begin_idx * base * SizeOfType(type()); + return dst; } - - inline void *mutable_data(std::type_index type) { - if (holder_ != nullptr) { - holder_->set_type(type); - } - // PADDLE_ENFORCE_GE(numel(), 0, - // "When calling this method, the Tensor's - // numel must be - // " "equal or larger than zero. " "Please - // check - // Tensor::Resize has been called first."); - int64_t size = numel() * SizeOfType(type); - /* some versions of boost::variant don't have operator!= */ - if (holder_ == nullptr || holder_->size() < size + offset_) { - holder_.reset(new PlaceholderImpl(size, type)); - - offset_ = 0; - } - return reinterpret_cast( - reinterpret_cast(holder_->ptr()) + offset_); + } + + std::type_index type() const { + // PADDLE_ENFORCE_NOT_NULL( + // holder_, "Tensor not initialized yet + // when + // Tensor::type() is called."); + return holder_->type(); + } + + // memory size returns the holding memory size in byte. + size_t memory_size() const { + return holder_ == nullptr ? 0UL : holder_->size() - offset_; + } + + inline void check_memory_size() const { + // PADDLE_ENFORCE_NOT_NULL( + // holder_, "Tensor holds no memory. Call + // Tensor::mutable_data + // first."); + // PADDLE_ENFORCE_LE( + // numel() * SizeOfType(type()), memory_size(), + // "Tensor's dims_ is out of bound. Call + // Tensor::mutable_data " + // "first to re-allocate memory.\n" + // "or maybe the required data-type mismatches the data + // already + // stored."); + } + + inline DataLayout layout() const { return layout_; } + + inline void set_layout(const DataLayout layout) { layout_ = layout; } + +private: + /** + * @note Placeholder hides type T, so it doesn't appear as a + * template + * parameter of Variable. + */ + struct Placeholder { + virtual ~Placeholder() = default; + + virtual void *ptr() const = 0; + + virtual size_t size() const = 0; + + virtual std::type_index type() const = 0; + + virtual void set_type(std::type_index type) = 0; + }; + + struct PlaceholderImpl : public Placeholder { + PlaceholderImpl(size_t size, std::type_index type) + : ptr_(static_cast(memory::Alloc(size)), + memory::PODDeleter()), + size_(size), type_(type) { + // PADDLE_ENFORCE_NOT_NULL(ptr_, + // "Insufficient %s + // memory to allocation.", + // (is_cpu_place(place_) + // ? + // "CPU" : + // "GPU")); } - inline void *mutable_data() { - // PADDLE_ENFORCE(this->holder_ != nullptr, - // "Cannot invoke mutable data if current hold - // nothing."); - return mutable_data(holder_->type()); - } + virtual size_t size() const { return size_; } - /** - * @brief Return a pointer to mutable memory block. - * - * @param[in] dims The dimensions of the memory block. - * @param[in] place The place of the memory block. - * - * @note If not exist, then allocation. - */ - template inline T *mutable_data(DDim dims) { - static_assert(std::is_pod::value, "T must be POD"); - Resize(dims); - return mutable_data(); - } + virtual void *ptr() const { return static_cast(ptr_.get()); } - /*! Return the dimensions of the memory block. */ - inline const DDim &dims() const { return dims_; } + virtual std::type_index type() const { return type_; } - /*! Return the numel of the memory block. */ - inline int64_t numel() const { return product(dims_); } + virtual void set_type(std::type_index type) { type_ = type; } - /*! Resize the dimensions of the memory block. */ - inline Tensor &Resize(const DDim &dims) { - dims_ = dims; - return *this; - } + /*! the pointer of memory block. */ + std::unique_ptr> ptr_; - /*! The internal of two tensors share the same memory block. */ - inline Tensor &ShareDataWith(const Tensor &src) { - src.check_memory_size(); - *this = src; - return *this; - } + /*! the size of memory block. */ + size_t size_; - /** - * @brief Return a sub-tensor of the given tensor. - * - * @param[in] begin_idx The index of the start row(inclusive) to - * slice. - * The index number begins from 0. - * @param[in] end_idx The index of the end row(exclusive) to - * slice. - * The index number begins from 0. - */ - inline Tensor Slice(int begin_idx, int end_idx) const { - check_memory_size(); - // PADDLE_ENFORCE_GE(begin_idx, 0, - // "The start row index must be greater than - // 0."); - // PADDLE_ENFORCE_LE(end_idx, dims_[0], "The end row index is - // out of - // bound."); PADDLE_ENFORCE_LT( - // begin_idx, end_idx, - // "The start row index must be lesser than the end row - // index."); - - if (dims_[0] == 1) { - return *this; - } else { - size_t base = numel() / dims_[0]; - Tensor dst; - dst.holder_ = holder_; - dst.set_layout(layout_); - DDim dst_dims = dims_; - dst_dims[0] = end_idx - begin_idx; - dst.Resize(dst_dims); - dst.offset_ = offset_ + begin_idx * base * SizeOfType(type()); - return dst; - } - } + /* the current type of memory */ + std::type_index type_; + }; - std::type_index type() const { - // PADDLE_ENFORCE_NOT_NULL( - // holder_, "Tensor not initialized yet - // when - // Tensor::type() is called."); - return holder_->type(); - } + /*! holds the memory block if allocated. */ + std::shared_ptr holder_; - // memory size returns the holding memory size in byte. - size_t memory_size() const { - return holder_ == nullptr ? 0UL : holder_->size() - offset_; - } + /** + * @brief points to elements dimensions. + * + * @note dims_ do not indicate the memory block size. + */ - inline void check_memory_size() const { - // PADDLE_ENFORCE_NOT_NULL( - // holder_, "Tensor holds no memory. Call - // Tensor::mutable_data - // first."); - // PADDLE_ENFORCE_LE( - // numel() * SizeOfType(type()), memory_size(), - // "Tensor's dims_ is out of bound. Call - // Tensor::mutable_data " - // "first to re-allocate memory.\n" - // "or maybe the required data-type mismatches the data - // already - // stored."); - } + DDim dims_; + + /** + * @brief the layout of memory block, default is NHWC. + * + * @note the memory allocation order, describe how weight/data is + * stored + * For example, in 4-D Tensor(rank=4), there are three + * commonly + * used layout. They are + * NCHW, NHWC, CHWN. + * N,C,H,W for respectively the batch size, the number of + * feature maps, the height, the width. + */ + + DataLayout layout_ = DataLayout::kNHWC; - inline DataLayout layout() const { return layout_; } - - inline void set_layout(const DataLayout layout) { layout_ = layout; } - - private: - /** - * @note Placeholder hides type T, so it doesn't appear as a - * template - * parameter of Variable. - */ - struct Placeholder { - virtual ~Placeholder() = default; - - virtual void *ptr() const = 0; - - virtual size_t size() const = 0; - - virtual std::type_index type() const = 0; - - virtual void set_type(std::type_index type) = 0; - }; - - struct PlaceholderImpl : public Placeholder { - PlaceholderImpl(size_t size, std::type_index type) - : ptr_(static_cast(memory::Alloc(size)), - memory::PODDeleter()), - size_(size), type_(type) { - // PADDLE_ENFORCE_NOT_NULL(ptr_, - // "Insufficient %s - // memory to allocation.", - // (is_cpu_place(place_) - // ? - // "CPU" : - // "GPU")); - } - - virtual size_t size() const { return size_; } - - virtual void *ptr() const { return static_cast(ptr_.get()); } - - virtual std::type_index type() const { return type_; } - - virtual void set_type(std::type_index type) { type_ = type; } - - /*! the pointer of memory block. */ - std::unique_ptr> ptr_; - - /*! the size of memory block. */ - size_t size_; - - /* the current type of memory */ - std::type_index type_; - }; - - /*! holds the memory block if allocated. */ - std::shared_ptr holder_; - - /** - * @brief points to elements dimensions. - * - * @note dims_ do not indicate the memory block size. - */ - - DDim dims_; - - /** - * @brief the layout of memory block, default is NHWC. - * - * @note the memory allocation order, describe how weight/data is - * stored - * For example, in 4-D Tensor(rank=4), there are three - * commonly - * used layout. They are - * NCHW, NHWC, CHWN. - * N,C,H,W for respectively the batch size, the number of - * feature maps, the height, the width. - */ - - DataLayout layout_ = DataLayout::kNHWC; - - /** - * @brief A PlaceHolder may be shared by more than one tensor. - * - * @note Some of them may be slices of the others. So the offset_ - * is introduced here to indicate the byte offset between - * PlaceHolder::ptr_ and where the tensor data really - * begins. - */ - size_t offset_; + /** + * @brief A PlaceHolder may be shared by more than one tensor. + * + * @note Some of them may be slices of the others. So the offset_ + * is introduced here to indicate the byte offset between + * PlaceHolder::ptr_ and where the tensor data really + * begins. + */ + size_t offset_; }; inline Tensor ReshapeToMatrix(const Tensor &src, int num_col_dims) { - Tensor res; - res.ShareDataWith(src); - res.Resize(flatten_to_2d(src.dims(), num_col_dims)); - return res; + Tensor res; + res.ShareDataWith(src); + res.Resize(flatten_to_2d(src.dims(), num_col_dims)); + return res; } } // namespace framework diff --git a/src/framework/tensor_util.cc b/src/framework/tensor_util.cc index 1b1e22ef59ec48cdf70f3ea2ad042553ac8d54c5..5ad00a0b9503a3306239d019f9063099f0d049ac 100644 --- a/src/framework/tensor_util.cc +++ b/src/framework/tensor_util.cc @@ -21,183 +21,182 @@ namespace paddle_mobile { namespace framework { void TensorCopy(const Tensor &src, Tensor *dst) { - // VLOG(3) << "TensorCopy " << src.dims() << " from " << - // src.place() << " to - // " - // << dst_place; - src.check_memory_size(); + // VLOG(3) << "TensorCopy " << src.dims() << " from " << + // src.place() << " to + // " + // << dst_place; + src.check_memory_size(); - dst->Resize(src.dims()); - dst->set_layout(src.layout()); - auto src_ptr = src.data(); + dst->Resize(src.dims()); + dst->set_layout(src.layout()); + auto src_ptr = src.data(); - auto dst_ptr = dst->mutable_data(src.type()); + auto dst_ptr = dst->mutable_data(src.type()); - auto size = src.numel() * SizeOfType(src.type()); + auto size = src.numel() * SizeOfType(src.type()); - memory::Copy(dst_ptr, src_ptr, size); + memory::Copy(dst_ptr, src_ptr, size); } void TensorCopySync(const Tensor &src, Tensor *dst) { - // VLOG(3) << "TensorCopySync " << src.dims() << " from " << - // src.place() - // << " to " << dst_place; - src.check_memory_size(); - dst->Resize(src.dims()); - dst->set_layout(src.layout()); - auto src_ptr = src.data(); - auto dst_ptr = dst->mutable_data(src.type()); - auto size = src.numel() * SizeOfType(src.type()); - memory::Copy(dst_ptr, src_ptr, size); + // VLOG(3) << "TensorCopySync " << src.dims() << " from " << + // src.place() + // << " to " << dst_place; + src.check_memory_size(); + dst->Resize(src.dims()); + dst->set_layout(src.layout()); + auto src_ptr = src.data(); + auto dst_ptr = dst->mutable_data(src.type()); + auto size = src.numel() * SizeOfType(src.type()); + memory::Copy(dst_ptr, src_ptr, size); } template struct AnyDTypeVisitor { - Predicate predicate_; - const Tensor &tensor_; - Tensor *out_; - - AnyDTypeVisitor(Predicate predicate, const Tensor &tensor, Tensor *out) - : predicate_(predicate), tensor_(tensor), out_(out) {} - - template void operator()() const { - // auto t = EigenVector::Flatten(tensor_); - // auto o = EigenScalar::From(*out_); - // return any of predicate_(t) is true. - // o.device(*ctx_.eigen_device()) = predicate_(t).any(); - } + Predicate predicate_; + const Tensor &tensor_; + Tensor *out_; + + AnyDTypeVisitor(Predicate predicate, const Tensor &tensor, Tensor *out) + : predicate_(predicate), tensor_(tensor), out_(out) {} + + template void operator()() const { + // auto t = EigenVector::Flatten(tensor_); + // auto o = EigenScalar::From(*out_); + // return any of predicate_(t) is true. + // o.device(*ctx_.eigen_device()) = predicate_(t).any(); + } }; template inline void AnyImpl(Predicate predicate, const Tensor &tensor, framework::Tensor *out) { - VisitDataType(ToDataType(tensor.type()), - AnyDTypeVisitor(predicate, tensor, out)); + VisitDataType(ToDataType(tensor.type()), + AnyDTypeVisitor(predicate, tensor, out)); } template struct AnyVisitor { - const framework::Tensor &tensor_; - Predicate predicate_; - - AnyVisitor(const framework::Tensor &tensor, Predicate predicate) - : tensor_(tensor), predicate_(std::move(predicate)) {} - - bool operator()(void) const { - framework::Tensor out; - out.Resize({1}); - out.mutable_data(); - AnyImpl(predicate_, tensor_, &out); - return this->GetResult(out); - } - - bool GetResult(const framework::Tensor &out) const { - return *out.data(); - } + const framework::Tensor &tensor_; + Predicate predicate_; + + AnyVisitor(const framework::Tensor &tensor, Predicate predicate) + : tensor_(tensor), predicate_(std::move(predicate)) {} + + bool operator()(void) const { + framework::Tensor out; + out.Resize({1}); + out.mutable_data(); + AnyImpl(predicate_, tensor_, &out); + return this->GetResult(out); + } + + bool GetResult(const framework::Tensor &out) const { + return *out.data(); + } }; template inline bool Any(const framework::Tensor &tensor, Predicate predicate) { - AnyVisitor visitor(tensor, predicate); - // return platform::VisitPlace(visitor); - return visitor(); + AnyVisitor visitor(tensor, predicate); + // return platform::VisitPlace(visitor); + return visitor(); } struct ContainsNANPredicate { - template - auto operator()(const T &eigen_vec) const - -> decltype(std::declval().isnan()) { - // Cast eigen_vector to vector of bool. true if is inf. - return eigen_vec.isnan(); - } + template + auto operator()(const T &eigen_vec) const + -> decltype(std::declval().isnan()) { + // Cast eigen_vector to vector of bool. true if is inf. + return eigen_vec.isnan(); + } }; bool TensorContainsNAN(const framework::Tensor &tensor) { - ContainsNANPredicate predicate; - return Any(tensor, predicate); + ContainsNANPredicate predicate; + return Any(tensor, predicate); } struct ContainsInfPredicate { - template - auto operator()(const T &eigen_vec) const - -> decltype(std::declval().isinf()) { - // Cast eigen_vector to vector of bool. true if is inf. - return eigen_vec.isinf(); - } + template + auto operator()(const T &eigen_vec) const + -> decltype(std::declval().isinf()) { + // Cast eigen_vector to vector of bool. true if is inf. + return eigen_vec.isinf(); + } }; bool TensorContainsInf(const framework::Tensor &tensor) { - ContainsInfPredicate predicate; - return Any(tensor, predicate); + ContainsInfPredicate predicate; + return Any(tensor, predicate); } void TensorToStream(std::ostream &os, const Tensor &tensor) { - { // the 1st field, uint32_t version - constexpr uint32_t version = 0; - os.write(reinterpret_cast(&version), sizeof(version)); - } - { // the 2nd field, tensor description - // int32_t size - // void* protobuf message - proto::VarType::TensorDesc desc; - desc.set_data_type(framework::ToDataType(tensor.type())); - auto dims = framework::vectorize(tensor.dims()); - auto *pb_dims = desc.mutable_dims(); - pb_dims->Resize(static_cast(dims.size()), 0); - std::copy(dims.begin(), dims.end(), pb_dims->begin()); - int32_t size = desc.ByteSize(); - os.write(reinterpret_cast(&size), sizeof(size)); - auto out = desc.SerializeAsString(); - os.write(out.data(), size); - } - { // the 3rd field, tensor data - uint64_t size = tensor.memory_size(); - auto *data_ptr = tensor.data(); - // PADDLE_ENFORCE(size < - // std::numeric_limits::max(), - // "Index overflow when writing tensor"); - - os.write(static_cast(data_ptr), - static_cast(size)); - } + { // the 1st field, uint32_t version + constexpr uint32_t version = 0; + os.write(reinterpret_cast(&version), sizeof(version)); + } + { // the 2nd field, tensor description + // int32_t size + // void* protobuf message + proto::VarType::TensorDesc desc; + desc.set_data_type(framework::ToDataType(tensor.type())); + auto dims = framework::vectorize(tensor.dims()); + auto *pb_dims = desc.mutable_dims(); + pb_dims->Resize(static_cast(dims.size()), 0); + std::copy(dims.begin(), dims.end(), pb_dims->begin()); + int32_t size = desc.ByteSize(); + os.write(reinterpret_cast(&size), sizeof(size)); + auto out = desc.SerializeAsString(); + os.write(out.data(), size); + } + { // the 3rd field, tensor data + uint64_t size = tensor.memory_size(); + auto *data_ptr = tensor.data(); + // PADDLE_ENFORCE(size < + // std::numeric_limits::max(), + // "Index overflow when writing tensor"); + + os.write(static_cast(data_ptr), + static_cast(size)); + } } struct DeserializedDataFunctor { - DeserializedDataFunctor(void **buf, Tensor *tensor) - : buf_(buf), tensor_(tensor) {} + DeserializedDataFunctor(void **buf, Tensor *tensor) + : buf_(buf), tensor_(tensor) {} - template void operator()() { - *buf_ = tensor_->mutable_data(); - } + template void operator()() { + *buf_ = tensor_->mutable_data(); + } - void **buf_; - Tensor *tensor_; + void **buf_; + Tensor *tensor_; }; void TensorFromStream(std::istream &is, framework::Tensor *tensor) { - uint32_t version; - is.read(reinterpret_cast(&version), sizeof(version)); - // PADDLE_ENFORCE_EQ(version, 0U, "Only version 0 is supported"); - proto::VarType::TensorDesc desc; - { // int32_t size - // proto buffer - int32_t size; - is.read(reinterpret_cast(&size), sizeof(size)); - std::unique_ptr buf(new char[size]); - is.read(reinterpret_cast(buf.get()), size); - // PADDLE_ENFORCE(desc.ParseFromArray(buf.get(), size), - // "Cannot parse tensor desc"); - } - { // read tensor - std::vector dims; - dims.reserve(static_cast(desc.dims().size())); - std::copy(desc.dims().begin(), desc.dims().end(), - std::back_inserter(dims)); - tensor->Resize(framework::make_ddim(dims)); - void *buf; - - framework::VisitDataType(desc.data_type(), - DeserializedDataFunctor(&buf, tensor)); - is.read(static_cast(buf), tensor->memory_size()); - } + uint32_t version; + is.read(reinterpret_cast(&version), sizeof(version)); + // PADDLE_ENFORCE_EQ(version, 0U, "Only version 0 is supported"); + proto::VarType::TensorDesc desc; + { // int32_t size + // proto buffer + int32_t size; + is.read(reinterpret_cast(&size), sizeof(size)); + std::unique_ptr buf(new char[size]); + is.read(reinterpret_cast(buf.get()), size); + // PADDLE_ENFORCE(desc.ParseFromArray(buf.get(), size), + // "Cannot parse tensor desc"); + } + { // read tensor + std::vector dims; + dims.reserve(static_cast(desc.dims().size())); + std::copy(desc.dims().begin(), desc.dims().end(), std::back_inserter(dims)); + tensor->Resize(framework::make_ddim(dims)); + void *buf; + + framework::VisitDataType(desc.data_type(), + DeserializedDataFunctor(&buf, tensor)); + is.read(static_cast(buf), tensor->memory_size()); + } } } // namespace framework diff --git a/src/framework/tensor_util.h b/src/framework/tensor_util.h index 97bc1b8f1422369447efb8ab4a032b6ebfb0ca04..2d91febf6129e94a29801ddd5df031329e604f68 100644 --- a/src/framework/tensor_util.h +++ b/src/framework/tensor_util.h @@ -43,23 +43,23 @@ void TensorFromStream(std::istream &is, Tensor *tensor); template void TensorFromVector(const std::vector &src, Tensor *dst) { - auto src_ptr = static_cast(src.data()); - dst->Resize({static_cast(src.size())}); - auto dst_ptr = static_cast(dst->mutable_data()); - auto size = src.size() * sizeof(T); + auto src_ptr = static_cast(src.data()); + dst->Resize({static_cast(src.size())}); + auto dst_ptr = static_cast(dst->mutable_data()); + auto size = src.size() * sizeof(T); - memory::Copy(dst_ptr, src_ptr, size); + memory::Copy(dst_ptr, src_ptr, size); } template void TensorToVector(const Tensor &src, std::vector *dst) { - auto src_ptr = static_cast(src.data()); - auto size = src.numel() * sizeof(T); + auto src_ptr = static_cast(src.data()); + auto size = src.numel() * sizeof(T); - dst->resize(src.numel()); - auto dst_ptr = static_cast(dst->data()); + dst->resize(src.numel()); + auto dst_ptr = static_cast(dst->data()); - memory::Copy(dst_ptr, src_ptr, size); + memory::Copy(dst_ptr, src_ptr, size); } } // namespace framework diff --git a/src/framework/var_desc.h b/src/framework/var_desc.h index cf2993f7f218b811e3b2cfe864acba99ec1f48a1..6852966a878c5be81de406b77b147f32d53de570 100644 --- a/src/framework/var_desc.h +++ b/src/framework/var_desc.h @@ -25,63 +25,63 @@ namespace paddle_mobile { namespace framework { class VarDesc { - public: - VarDesc(const proto::VarDesc &desc); +public: + VarDesc(const proto::VarDesc &desc); - std::string Name() const { return desc_.name(); } + std::string Name() const { return desc_.name(); } - proto::VarType::Type GetType() const { return desc_.type().type(); } + proto::VarType::Type GetType() const { return desc_.type().type(); } - bool Persistable() const { return desc_.persistable(); } + bool Persistable() const { return desc_.persistable(); } - const proto::VarType::ChannelDesc &channel_desc() const { - switch (desc_.type().type()) { - case proto::VarType::CHANNEL: - return desc_.type().channel(); - default: - break; - } + const proto::VarType::ChannelDesc &channel_desc() const { + switch (desc_.type().type()) { + case proto::VarType::CHANNEL: + return desc_.type().channel(); + default: + break; } + } - const proto::VarType::TensorDesc &tensor_desc() const { - switch (desc_.type().type()) { - case proto::VarType::SELECTED_ROWS: - return desc_.type().selected_rows(); - case proto::VarType::LOD_TENSOR: - return desc_.type().lod_tensor().tensor(); - case proto::VarType::LOD_TENSOR_ARRAY: - return desc_.type().tensor_array().tensor(); - default: - break; - } + const proto::VarType::TensorDesc &tensor_desc() const { + switch (desc_.type().type()) { + case proto::VarType::SELECTED_ROWS: + return desc_.type().selected_rows(); + case proto::VarType::LOD_TENSOR: + return desc_.type().lod_tensor().tensor(); + case proto::VarType::LOD_TENSOR_ARRAY: + return desc_.type().tensor_array().tensor(); + default: + break; } + } - proto::VarType::Type GetDataType() const { - switch (desc_.type().type()) { - case proto::VarType::CHANNEL: - return channel_desc().data_type(); - break; - default: - return tensor_desc().data_type(); - } + proto::VarType::Type GetDataType() const { + switch (desc_.type().type()) { + case proto::VarType::CHANNEL: + return channel_desc().data_type(); + break; + default: + return tensor_desc().data_type(); } + } - template - std::vector RepeatedToVector( - const google::protobuf::RepeatedField &repeated_field) const { - std::vector ret; - ret.reserve(repeated_field.size()); - std::copy(repeated_field.begin(), repeated_field.end(), - std::back_inserter(ret)); - return ret; - } + template + std::vector RepeatedToVector( + const google::protobuf::RepeatedField &repeated_field) const { + std::vector ret; + ret.reserve(repeated_field.size()); + std::copy(repeated_field.begin(), repeated_field.end(), + std::back_inserter(ret)); + return ret; + } - std::vector GetShape() const { - return this->RepeatedToVector(tensor_desc().dims()); - } + std::vector GetShape() const { + return this->RepeatedToVector(tensor_desc().dims()); + } - private: - proto::VarDesc desc_; +private: + proto::VarDesc desc_; }; } // namespace framework diff --git a/src/framework/var_type.h b/src/framework/var_type.h index d4d4197270b9923b4c5320bb5f97ee7c8277e1a7..06db5ed1d66bcb4cd4f6237b7d51ca27259307b2 100644 --- a/src/framework/var_type.h +++ b/src/framework/var_type.h @@ -25,14 +25,14 @@ SOFTWARE. namespace paddle_mobile { namespace framework { inline proto::VarType::Type ToVarType(std::type_index type) { - if (type.hash_code() == typeid(LoDTensor).hash_code()) { - return proto::VarType_Type_LOD_TENSOR; - } else if (type.hash_code() == typeid(SelectedRows).hash_code()) { - return proto::VarType_Type_SELECTED_ROWS; - } else { - // PADDLE_THROW("ToVarType:Unsupported type %s", - // type.name()); - } + if (type.hash_code() == typeid(LoDTensor).hash_code()) { + return proto::VarType_Type_LOD_TENSOR; + } else if (type.hash_code() == typeid(SelectedRows).hash_code()) { + return proto::VarType_Type_SELECTED_ROWS; + } else { + // PADDLE_THROW("ToVarType:Unsupported type %s", + // type.name()); + } } } // namespace framework diff --git a/src/framework/variable.h b/src/framework/variable.h index 5642c3de0de7ab30d9483c1953f675433047cf5c..5d1a17943e78abd2006517855e709fd3d3315d6b 100644 --- a/src/framework/variable.h +++ b/src/framework/variable.h @@ -28,69 +28,69 @@ SOFTWARE. namespace paddle_mobile { namespace framework { class Variable : public PaddleMobileObject { - public: - template const T *Get() const { - return static_cast(holder_->Ptr()); +public: + template const T *Get() const { + return static_cast(holder_->Ptr()); + } + + bool IsInitialized() const { return holder_ != nullptr; } + + const std::string *Name() { return name_; } + + template T *GetMutable() { + if (!IsType()) { + if (*Name() == "pixel") { + // std::cout << " reset " << *Name() << + // std::endl; + } + holder_.reset(new PlaceholderImp(new T())); } - - bool IsInitialized() const { return holder_ != nullptr; } - - const std::string *Name() { return name_; } - - template T *GetMutable() { - if (!IsType()) { - if (*Name() == "pixel") { - // std::cout << " reset " << *Name() << - // std::endl; - } - holder_.reset(new PlaceholderImp(new T())); - } - return static_cast(holder_->Ptr()); + return static_cast(holder_->Ptr()); + } + + template bool IsType() const { + if (holder_) { + // printf("not null \n"); + printf(" holder type : %s, this type %s \n", holder_->Type().name(), + typeid(T).name()); } - template bool IsType() const { - if (holder_) { - // printf("not null \n"); - printf(" holder type : %s, this type %s \n", holder_->Type().name(), - typeid(T).name()); - } - - // std::cout << " " << holder_->Type() << " " << - // typeid(T) << - // std::endl; - return holder_ != nullptr && holder_->Type() == typeid(T); - } + // std::cout << " " << holder_->Type() << " " << + // typeid(T) << + // std::endl; + return holder_ != nullptr && holder_->Type() == typeid(T); + } - void Clear() { holder_.reset(); } + void Clear() { holder_.reset(); } - std::type_index Type() const { return holder_->Type(); } + std::type_index Type() const { return holder_->Type(); } - void SetName(const std::string *name) { name_ = name; } + void SetName(const std::string *name) { name_ = name; } - private: - struct Placeholder { - Placeholder() = default; - virtual ~Placeholder() = default; +private: + struct Placeholder { + Placeholder() = default; + virtual ~Placeholder() = default; - virtual const std::type_info &Type() const = 0; - virtual void *Ptr() const = 0; - }; + virtual const std::type_info &Type() const = 0; + virtual void *Ptr() const = 0; + }; - template struct PlaceholderImp : public Placeholder { - explicit PlaceholderImp(T *ptr) : ptr_(ptr), type_(typeid(T)) {} + template struct PlaceholderImp : public Placeholder { + explicit PlaceholderImp(T *ptr) : ptr_(ptr), type_(typeid(T)) {} - virtual const std::type_info &Type() const { return type_; } - virtual void *Ptr() const override { - return static_cast(ptr_.get()); - } + virtual const std::type_info &Type() const { return type_; } + virtual void *Ptr() const override { + return static_cast(ptr_.get()); + } - std::unique_ptr ptr_; - const std::type_info &type_; - }; + std::unique_ptr ptr_; + const std::type_info &type_; + }; - std::unique_ptr holder_; - friend class Scope; - const std::string *name_; + std::unique_ptr holder_; + friend class Scope; + const std::string *name_; }; } // namespace framework } // namespace paddle_mobile diff --git a/src/io.cpp b/src/io.cpp index 03f184859d401f709bb3c53233f17441de5435d0..c6dc3a3416dce5f3802817195040ba13bb53aeba 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -29,361 +29,357 @@ SOFTWARE. namespace paddle_mobile { void ReadBinaryFile(const std::string &filename, std::string *contents) { - std::ifstream fin(filename, std::ios::in | std::ios::binary); - fin.seekg(0, std::ios::end); - contents->clear(); - contents->resize(fin.tellg()); - fin.seekg(0, std::ios::beg); - fin.read(&(contents->at(0)), contents->size()); - fin.close(); + std::ifstream fin(filename, std::ios::in | std::ios::binary); + fin.seekg(0, std::ios::end); + contents->clear(); + contents->resize(fin.tellg()); + fin.seekg(0, std::ios::beg); + fin.read(&(contents->at(0)), contents->size()); + fin.close(); } template void Loader::LoadVar(framework::LoDTensor *tensor, const std::string &file_path) { - // LOG(kLOG_DEBUG) << " to load " << file_path; - // Log(kLOG_DEBUG) << "123"; - - std::ifstream is(file_path); - - std::streampos pos = is.tellg(); // save current position - is.seekg(0, std::ios::end); - // LOG(kLOG_DEBUG) << " file length = " << is.tellg(); - is.seekg(pos); // restore saved position - - // 1. version - uint32_t version; - is.read(reinterpret_cast(&version), sizeof(version)); - // LOG(kLOG_INFO) << " version: " << version; - - // 2 Lod information - uint64_t lod_level; - is.read(reinterpret_cast(&lod_level), sizeof(lod_level)); - // LOG(kLOG_DEBUG) << " load level: " << lod_level; - // LOG(kLOG_DEBUG) << " lod info: "; - auto &lod = *tensor->mutable_lod(); - lod.resize(lod_level); - for (uint64_t i = 0; i < lod_level; ++i) { - uint64_t size; - is.read(reinterpret_cast(&size), sizeof(size)); - std::vector tmp(size / sizeof(size_t)); - is.read(reinterpret_cast(tmp.data()), - static_cast(size)); - for (int j = 0; j < tmp.size(); ++j) { - LOG(kLOG_DEBUG1) << " lod - " << tmp[j]; - } - lod[i] = tmp; - } - - // 3. tensor version - uint32_t tensor_version; - is.read(reinterpret_cast(&tensor_version), sizeof(tensor_version)); - // std::cout << " tensor_version: " << tensor_version << std::endl; - - // 4. tensor desc - int32_t size; + // LOG(kLOG_DEBUG) << " to load " << file_path; + // Log(kLOG_DEBUG) << "123"; + + std::ifstream is(file_path); + + std::streampos pos = is.tellg(); // save current position + is.seekg(0, std::ios::end); + // LOG(kLOG_DEBUG) << " file length = " << is.tellg(); + is.seekg(pos); // restore saved position + + // 1. version + uint32_t version; + is.read(reinterpret_cast(&version), sizeof(version)); + // LOG(kLOG_INFO) << " version: " << version; + + // 2 Lod information + uint64_t lod_level; + is.read(reinterpret_cast(&lod_level), sizeof(lod_level)); + // LOG(kLOG_DEBUG) << " load level: " << lod_level; + // LOG(kLOG_DEBUG) << " lod info: "; + auto &lod = *tensor->mutable_lod(); + lod.resize(lod_level); + for (uint64_t i = 0; i < lod_level; ++i) { + uint64_t size; is.read(reinterpret_cast(&size), sizeof(size)); - // std::cout << " tensor desc size: " << size << std::endl; - std::unique_ptr buf(new char[size]); - is.read(reinterpret_cast(buf.get()), size); - - framework::proto::VarType::TensorDesc desc; - desc.ParseFromArray(buf.get(), size); - - // std::cout << " desc dims size " << desc.dims().size() << - // std::endl; - int memory_size = 1; - for (int l = 0; l < desc.dims().size(); ++l) { - // std::cout << " dim " << l << " value: " << desc.dims()[l] - // << - // std::endl; - memory_size *= desc.dims()[l]; - } - - std::vector dims; - dims.reserve(static_cast(desc.dims().size())); - std::copy(desc.dims().begin(), desc.dims().end(), std::back_inserter(dims)); - tensor->Resize(framework::make_ddim(dims)); - - void *memory; - int type_size = 0; - // std::cout << " desc pre type: "; - switch (desc.data_type()) { - case framework::proto::VarType::FP16: - // std::cout << "FP16" << std::endl; - type_size = 2; - break; - case framework::proto::VarType::FP32: - type_size = 4; - memory = tensor->mutable_data(); - // std::cout << "FP32" << std::endl; - break; - case framework::proto::VarType::FP64: - type_size = 8; - // std::cout << "FP64" << std::endl; - break; - case framework::proto::VarType::INT32: - type_size = 4; - // std::cout << "INT32" << std::endl; - break; - case framework::proto::VarType::INT64: - type_size = 8; - // std::cout << "INT64" << std::endl; - break; - case framework::proto::VarType::BOOL: - type_size = 1; - // std::cout << "BOOL" << std::endl; - break; - default: - break; - // std::cout << " not support" << std::endl; + std::vector tmp(size / sizeof(size_t)); + is.read(reinterpret_cast(tmp.data()), + static_cast(size)); + for (int j = 0; j < tmp.size(); ++j) { + LOG(kLOG_DEBUG1) << " lod - " << tmp[j]; } - - // std::cout << " malloc size: " << memory_size * type_size << - // std::endl; - is.read(static_cast(memory), memory_size * type_size); - // std::cout << " memory: " << memory << std::endl; - is.close(); + lod[i] = tmp; + } + + // 3. tensor version + uint32_t tensor_version; + is.read(reinterpret_cast(&tensor_version), sizeof(tensor_version)); + // std::cout << " tensor_version: " << tensor_version << std::endl; + + // 4. tensor desc + int32_t size; + is.read(reinterpret_cast(&size), sizeof(size)); + // std::cout << " tensor desc size: " << size << std::endl; + std::unique_ptr buf(new char[size]); + is.read(reinterpret_cast(buf.get()), size); + + framework::proto::VarType::TensorDesc desc; + desc.ParseFromArray(buf.get(), size); + + // std::cout << " desc dims size " << desc.dims().size() << + // std::endl; + int memory_size = 1; + for (int l = 0; l < desc.dims().size(); ++l) { + // std::cout << " dim " << l << " value: " << desc.dims()[l] + // << + // std::endl; + memory_size *= desc.dims()[l]; + } + + std::vector dims; + dims.reserve(static_cast(desc.dims().size())); + std::copy(desc.dims().begin(), desc.dims().end(), std::back_inserter(dims)); + tensor->Resize(framework::make_ddim(dims)); + + void *memory; + int type_size = 0; + // std::cout << " desc pre type: "; + switch (desc.data_type()) { + case framework::proto::VarType::FP16: + // std::cout << "FP16" << std::endl; + type_size = 2; + break; + case framework::proto::VarType::FP32: + type_size = 4; + memory = tensor->mutable_data(); + // std::cout << "FP32" << std::endl; + break; + case framework::proto::VarType::FP64: + type_size = 8; + // std::cout << "FP64" << std::endl; + break; + case framework::proto::VarType::INT32: + type_size = 4; + // std::cout << "INT32" << std::endl; + break; + case framework::proto::VarType::INT64: + type_size = 8; + // std::cout << "INT64" << std::endl; + break; + case framework::proto::VarType::BOOL: + type_size = 1; + // std::cout << "BOOL" << std::endl; + break; + default: + break; + // std::cout << " not support" << std::endl; + } + + // std::cout << " malloc size: " << memory_size * type_size << + // std::endl; + is.read(static_cast(memory), memory_size * type_size); + // std::cout << " memory: " << memory << std::endl; + is.close(); }; template const framework::Program Loader::Load(const std::string &dirname) { - std::string model_filename = dirname + "/__model__"; - std::string program_desc_str; - ReadBinaryFile(model_filename, &program_desc_str); - framework::proto::ProgramDesc program_desc_proto; - program_desc_proto.ParseFromString(program_desc_str); - - std::shared_ptr originProgramDesc = - std::make_shared(program_desc_proto); - - framework::Program program; - program.originProgram = originProgramDesc; - - std::shared_ptr scope = - std::make_shared(); - program.scope = scope; - - auto block = originProgramDesc->Block(0); - - for (auto block : originProgramDesc->Blocks()) { - // std::cout << "for block" << std::endl; - for (int i = 0; i < block->Vars().size(); ++i) { - std::shared_ptr var_desc = block->Vars()[i]; - auto var = scope->Var(var_desc->Name()); - if (var_desc->GetType() == framework::proto::VarType::LOD_TENSOR) { - if (var_desc->Persistable() && - var_desc->GetType() != - framework::proto::VarType::FEED_MINIBATCH && - var_desc->GetType() != - framework::proto::VarType::FETCH_LIST) { - framework::LoDTensor *tensor = - var->GetMutable(); - // to load - LoadVar(tensor, dirname + "/" + var_desc->Name()); - } - } else { - // std::cout << "非 lod" << std::endl; - } + std::string model_filename = dirname + "/__model__"; + std::string program_desc_str; + ReadBinaryFile(model_filename, &program_desc_str); + framework::proto::ProgramDesc program_desc_proto; + program_desc_proto.ParseFromString(program_desc_str); + + std::shared_ptr originProgramDesc = + std::make_shared(program_desc_proto); + + framework::Program program; + program.originProgram = originProgramDesc; + + std::shared_ptr scope = + std::make_shared(); + program.scope = scope; + + auto block = originProgramDesc->Block(0); + + for (auto block : originProgramDesc->Blocks()) { + // std::cout << "for block" << std::endl; + for (int i = 0; i < block->Vars().size(); ++i) { + std::shared_ptr var_desc = block->Vars()[i]; + auto var = scope->Var(var_desc->Name()); + if (var_desc->GetType() == framework::proto::VarType::LOD_TENSOR) { + if (var_desc->Persistable() && + var_desc->GetType() != framework::proto::VarType::FEED_MINIBATCH && + var_desc->GetType() != framework::proto::VarType::FETCH_LIST) { + framework::LoDTensor *tensor = + var->GetMutable(); + // to load + LoadVar(tensor, dirname + "/" + var_desc->Name()); } + } else { + // std::cout << "非 lod" << std::endl; + } } + } #ifdef PADDLE_MOBILE_DEBUG - for (int i = 0; i < program_desc_proto.blocks().size(); ++i) { - framework::proto::BlockDesc block = program_desc_proto.blocks()[i]; - LOG(kLOG_DEBUG) << "block: " << block.idx(); - for (int j = 0; j < block.ops().size(); ++j) { - if (j == 2) { - break; - } - framework::proto::OpDesc op = block.ops()[j]; - LOG(kLOG_DEBUG1) << "op: " << op.type(); - for (int m = 0; m < op.inputs_size(); ++m) { - const framework::proto::OpDesc::Var &var = op.inputs(m); - LOG(kLOG_DEBUG2) << "input parameter: " << var.parameter(); - for (int n = 0; n < var.arguments().size(); ++n) { - LOG(kLOG_DEBUG3) << "argument - " << var.arguments()[n]; - } - } - - for (int y = 0; y < op.outputs_size(); ++y) { - const framework::proto::OpDesc::Var &var = op.outputs(y); - LOG(kLOG_DEBUG2) << "out parameter: " << var.parameter(); - for (int z = 0; z < var.arguments().size(); ++z) { - LOG(kLOG_DEBUG3) << "argument - " << var.arguments()[z]; - } - } - - for (int x = 0; x < op.attrs().size(); ++x) { - const framework::proto::OpDesc_Attr attr = op.attrs()[x]; - LOG(kLOG_DEBUG2) << "attr name: " << attr.name(); - - switch (attr.type()) { - case framework::proto::AttrType::BOOLEAN: - LOG(kLOG_DEBUG3) << "boolen: " << attr.b(); - break; - case framework::proto::AttrType::INT: - LOG(kLOG_DEBUG3) << "int: " << attr.i(); - break; - case framework::proto::AttrType::FLOAT: - LOG(kLOG_DEBUG3) << "float: " << attr.f(); - case framework::proto::AttrType::STRING: - LOG(kLOG_DEBUG3) << "string: " << attr.s(); - case framework::proto::AttrType::BOOLEANS: - for (int y = 0; y < attr.bools_size(); ++y) { - LOG(kLOG_DEBUG3) << "bools: " << attr.bools(y); - } - case framework::proto::AttrType::LONG: - LOG(kLOG_DEBUG3) << "long: " << attr.l(); - case framework::proto::AttrType::FLOATS: - for (int y = 0; y < attr.floats_size(); ++y) { - LOG(kLOG_DEBUG3) << "floats: " << attr.floats(y); - } - case framework::proto::AttrType::INTS: - for (int y = 0; y < attr.ints_size(); ++y) { - LOG(kLOG_DEBUG3) << "ints: " << attr.ints(y); - } - case framework::proto::AttrType::STRINGS: - for (int y = 0; y < attr.strings_size(); ++y) { - LOG(kLOG_DEBUG3) << "strings: " << attr.strings(y); - } - } - } + for (int i = 0; i < program_desc_proto.blocks().size(); ++i) { + framework::proto::BlockDesc block = program_desc_proto.blocks()[i]; + LOG(kLOG_DEBUG) << "block: " << block.idx(); + for (int j = 0; j < block.ops().size(); ++j) { + if (j == 2) { + break; + } + framework::proto::OpDesc op = block.ops()[j]; + LOG(kLOG_DEBUG1) << "op: " << op.type(); + for (int m = 0; m < op.inputs_size(); ++m) { + const framework::proto::OpDesc::Var &var = op.inputs(m); + LOG(kLOG_DEBUG2) << "input parameter: " << var.parameter(); + for (int n = 0; n < var.arguments().size(); ++n) { + LOG(kLOG_DEBUG3) << "argument - " << var.arguments()[n]; + } + } + + for (int y = 0; y < op.outputs_size(); ++y) { + const framework::proto::OpDesc::Var &var = op.outputs(y); + LOG(kLOG_DEBUG2) << "out parameter: " << var.parameter(); + for (int z = 0; z < var.arguments().size(); ++z) { + LOG(kLOG_DEBUG3) << "argument - " << var.arguments()[z]; + } + } + + for (int x = 0; x < op.attrs().size(); ++x) { + const framework::proto::OpDesc_Attr attr = op.attrs()[x]; + LOG(kLOG_DEBUG2) << "attr name: " << attr.name(); + + switch (attr.type()) { + case framework::proto::AttrType::BOOLEAN: + LOG(kLOG_DEBUG3) << "boolen: " << attr.b(); + break; + case framework::proto::AttrType::INT: + LOG(kLOG_DEBUG3) << "int: " << attr.i(); + break; + case framework::proto::AttrType::FLOAT: + LOG(kLOG_DEBUG3) << "float: " << attr.f(); + case framework::proto::AttrType::STRING: + LOG(kLOG_DEBUG3) << "string: " << attr.s(); + case framework::proto::AttrType::BOOLEANS: + for (int y = 0; y < attr.bools_size(); ++y) { + LOG(kLOG_DEBUG3) << "bools: " << attr.bools(y); + } + case framework::proto::AttrType::LONG: + LOG(kLOG_DEBUG3) << "long: " << attr.l(); + case framework::proto::AttrType::FLOATS: + for (int y = 0; y < attr.floats_size(); ++y) { + LOG(kLOG_DEBUG3) << "floats: " << attr.floats(y); + } + case framework::proto::AttrType::INTS: + for (int y = 0; y < attr.ints_size(); ++y) { + LOG(kLOG_DEBUG3) << "ints: " << attr.ints(y); + } + case framework::proto::AttrType::STRINGS: + for (int y = 0; y < attr.strings_size(); ++y) { + LOG(kLOG_DEBUG3) << "strings: " << attr.strings(y); + } + } + } + } + + for (int k = 0; k < block.vars().size(); ++k) { + framework::proto::VarDesc var = block.vars()[k]; + if (var.type().type() == framework::proto::VarType::LOD_TENSOR) { + LOG(kLOG_DEBUG1) << "var name: " << var.name(); + const framework::proto::VarType::TensorDesc &tensor_desc = + var.type().lod_tensor().tensor(); + LOG(kLOG_DEBUG2) << "in var tensor desc dims size: " + << tensor_desc.dims().size(); + int memory_size = 1; + for (int l = 0; l < tensor_desc.dims().size(); ++l) { + LOG(kLOG_DEBUG3) << "var tensor desc dim " << l + << " value: " << tensor_desc.dims()[l]; + } + } + + if (var.persistable() && + var.type().type() != framework::proto::VarType::FEED_MINIBATCH && + var.type().type() != framework::proto::VarType::FETCH_LIST) { + // std::cout << " to load " << var.name() << + // std::endl; + std::string file_path = dirname + "/" + var.name(); + std::ifstream is(file_path); + std::streampos pos = is.tellg(); // save current position + is.seekg(0, std::ios::end); + // std::cout << " file length = " << is.tellg() << + // std::endl; + is.seekg(pos); // restore saved position + + // 1. version + uint32_t version; + is.read(reinterpret_cast(&version), sizeof(version)); + // std::cout << " version: " << version << + // std::endl; + + // 2 Lod information + uint64_t lod_level; + is.read(reinterpret_cast(&lod_level), sizeof(lod_level)); + // std::cout << " load level: " << lod_level << + // std::endl; + // std::cout << " lod info: " << std::endl; + for (uint64_t i = 0; i < lod_level; ++i) { + uint64_t size; + is.read(reinterpret_cast(&size), sizeof(size)); + std::vector tmp(size / sizeof(size_t)); + is.read(reinterpret_cast(tmp.data()), + static_cast(size)); + for (int j = 0; j < tmp.size(); ++j) { + // std::cout << " lod - " << tmp[j] << + // std::endl; + } } - for (int k = 0; k < block.vars().size(); ++k) { - framework::proto::VarDesc var = block.vars()[k]; - if (var.type().type() == framework::proto::VarType::LOD_TENSOR) { - LOG(kLOG_DEBUG1) << "var name: " << var.name(); - const framework::proto::VarType::TensorDesc &tensor_desc = - var.type().lod_tensor().tensor(); - LOG(kLOG_DEBUG2) << "in var tensor desc dims size: " - << tensor_desc.dims().size(); - int memory_size = 1; - for (int l = 0; l < tensor_desc.dims().size(); ++l) { - LOG(kLOG_DEBUG3) << "var tensor desc dim " << l - << " value: " << tensor_desc.dims()[l]; - } - } - - if (var.persistable() && - var.type().type() != - framework::proto::VarType::FEED_MINIBATCH && - var.type().type() != framework::proto::VarType::FETCH_LIST) { - // std::cout << " to load " << var.name() << - // std::endl; - std::string file_path = dirname + "/" + var.name(); - std::ifstream is(file_path); - std::streampos pos = is.tellg(); // save current position - is.seekg(0, std::ios::end); - // std::cout << " file length = " << is.tellg() << - // std::endl; - is.seekg(pos); // restore saved position - - // 1. version - uint32_t version; - is.read(reinterpret_cast(&version), sizeof(version)); - // std::cout << " version: " << version << - // std::endl; - - // 2 Lod information - uint64_t lod_level; - is.read(reinterpret_cast(&lod_level), - sizeof(lod_level)); - // std::cout << " load level: " << lod_level << - // std::endl; - // std::cout << " lod info: " << std::endl; - for (uint64_t i = 0; i < lod_level; ++i) { - uint64_t size; - is.read(reinterpret_cast(&size), sizeof(size)); - std::vector tmp(size / sizeof(size_t)); - is.read(reinterpret_cast(tmp.data()), - static_cast(size)); - for (int j = 0; j < tmp.size(); ++j) { - // std::cout << " lod - " << tmp[j] << - // std::endl; - } - } - - uint32_t tensor_version; - is.read(reinterpret_cast(&version), sizeof(version)); - // std::cout << " tensor_version: " << - // tensor_version << - // std::endl; - - int32_t size; - is.read(reinterpret_cast(&size), sizeof(size)); - // std::cout << " tensor desc size: " << size << - // std::endl; - std::unique_ptr buf(new char[size]); - is.read(reinterpret_cast(buf.get()), size); - - framework::proto::VarType::TensorDesc desc; - desc.ParseFromArray(buf.get(), size); - - // std::cout << " desc dims size " << - // desc.dims().size() << - // std::endl; - int memory_size = 1; - for (int l = 0; l < desc.dims().size(); ++l) { - // std::cout << " dim " << l << " value: " - // << - // desc.dims()[l] - // << std::endl; - memory_size *= desc.dims()[l]; - } - - int type_size = 0; - // std::cout << " desc pre type: "; - switch (desc.data_type()) { - case framework::proto::VarType::FP16: - // std::cout << "FP16" << std::endl; - type_size = 2; - break; - case framework::proto::VarType::FP32: - type_size = 4; - // std::cout << "FP32" << std::endl; - break; - case framework::proto::VarType::FP64: - type_size = 8; - // std::cout << "FP64" << std::endl; - break; - case framework::proto::VarType::INT32: - type_size = 4; - // std::cout << "INT32" << std::endl; - break; - case framework::proto::VarType::INT64: - type_size = 8; - // std::cout << "INT64" << std::endl; - break; - case framework::proto::VarType::BOOL: - type_size = 1; - // std::cout << "BOOL" << std::endl; - break; - default: - break; - // std::cout << " not support" << - // std::endl; - } - - // std::cout << " malloc size: " << memory_size * - // type_size - // << std::endl; - void *memory = malloc(memory_size * type_size); - is.read(static_cast(memory), memory_size * type_size); - // std::cout << " memory: " << memory << - // std::endl; - is.close(); - } else { - // std::cout << " *not load " - // << " var : " << var.name() << std::endl; - } + uint32_t tensor_version; + is.read(reinterpret_cast(&version), sizeof(version)); + // std::cout << " tensor_version: " << + // tensor_version << + // std::endl; + + int32_t size; + is.read(reinterpret_cast(&size), sizeof(size)); + // std::cout << " tensor desc size: " << size << + // std::endl; + std::unique_ptr buf(new char[size]); + is.read(reinterpret_cast(buf.get()), size); + + framework::proto::VarType::TensorDesc desc; + desc.ParseFromArray(buf.get(), size); + + // std::cout << " desc dims size " << + // desc.dims().size() << + // std::endl; + int memory_size = 1; + for (int l = 0; l < desc.dims().size(); ++l) { + // std::cout << " dim " << l << " value: " + // << + // desc.dims()[l] + // << std::endl; + memory_size *= desc.dims()[l]; } + + int type_size = 0; + // std::cout << " desc pre type: "; + switch (desc.data_type()) { + case framework::proto::VarType::FP16: + // std::cout << "FP16" << std::endl; + type_size = 2; + break; + case framework::proto::VarType::FP32: + type_size = 4; + // std::cout << "FP32" << std::endl; + break; + case framework::proto::VarType::FP64: + type_size = 8; + // std::cout << "FP64" << std::endl; + break; + case framework::proto::VarType::INT32: + type_size = 4; + // std::cout << "INT32" << std::endl; + break; + case framework::proto::VarType::INT64: + type_size = 8; + // std::cout << "INT64" << std::endl; + break; + case framework::proto::VarType::BOOL: + type_size = 1; + // std::cout << "BOOL" << std::endl; + break; + default: + break; + // std::cout << " not support" << + // std::endl; + } + + // std::cout << " malloc size: " << memory_size * + // type_size + // << std::endl; + void *memory = malloc(memory_size * type_size); + is.read(static_cast(memory), memory_size * type_size); + // std::cout << " memory: " << memory << + // std::endl; + is.close(); + } else { + // std::cout << " *not load " + // << " var : " << var.name() << std::endl; + } } + } #endif - return program; + return program; } template class Loader; diff --git a/src/io.h b/src/io.h index 19f9e3099869a407c816d75681495ac8b5ce370e..25837358c2f96f6214f5b3e15ea87a85452a5853 100644 --- a/src/io.h +++ b/src/io.h @@ -29,11 +29,11 @@ namespace paddle_mobile { template class Loader : PaddleMobileObject { - public: - const framework::Program Load(const std::string &dirname); +public: + const framework::Program Load(const std::string &dirname); - private: - void LoadVar(framework::LoDTensor *tensor, const std::string &file_path); +private: + void LoadVar(framework::LoDTensor *tensor, const std::string &file_path); }; } // namespace paddle_mobile diff --git a/src/memory/t_malloc.cc b/src/memory/t_malloc.cc index 7cf73ab4f3c4f8e950ff8c94786a7667b50572ec..5b3086a8b04fe9f10e8151d5af781c24306de180 100644 --- a/src/memory/t_malloc.cc +++ b/src/memory/t_malloc.cc @@ -26,25 +26,25 @@ namespace memory { const int MALLOC_ALIGN = 16; void Copy(void *dst, const void *src, size_t num) { - std::memcpy(dst, src, num); + std::memcpy(dst, src, num); }; void *Alloc(size_t size) { - size_t offset = sizeof(void *) + MALLOC_ALIGN - 1; - char *p = static_cast(malloc(offset + size)); - if (!p) { - return nullptr; - } - void *r = reinterpret_cast(reinterpret_cast(p + offset) & - (~(MALLOC_ALIGN - 1))); - static_cast(r)[-1] = p; - return r; + size_t offset = sizeof(void *) + MALLOC_ALIGN - 1; + char *p = static_cast(malloc(offset + size)); + if (!p) { + return nullptr; + } + void *r = reinterpret_cast(reinterpret_cast(p + offset) & + (~(MALLOC_ALIGN - 1))); + static_cast(r)[-1] = p; + return r; } void Free(void *ptr) { - if (ptr) { - free(static_cast(ptr)[-1]); - } + if (ptr) { + free(static_cast(ptr)[-1]); + } } } // namespace memory diff --git a/src/memory/t_malloc.h b/src/memory/t_malloc.h index 5862df1e06b605d54bedeadab742ffe4b3ac21f1..cd2e0e68358d1b592d63853d3d2bfe0ae3df5a0f 100644 --- a/src/memory/t_malloc.h +++ b/src/memory/t_malloc.h @@ -38,12 +38,12 @@ void Free(void *ptr); * static_cast */ template class PODDeleter { - static_assert(std::is_pod::value, "T must be POD"); + static_assert(std::is_pod::value, "T must be POD"); - public: - explicit PODDeleter(){}; +public: + explicit PODDeleter(){}; - void operator()(T *ptr) { Free(static_cast(ptr)); } + void operator()(T *ptr) { Free(static_cast(ptr)); } }; /** @@ -55,10 +55,10 @@ template class PODDeleter { * reinterpret_cast */ template class PlainDeleter { - public: - explicit PlainDeleter(){}; +public: + explicit PlainDeleter(){}; - void operator()(T *ptr) { Free(reinterpret_cast(ptr)); } + void operator()(T *ptr) { Free(reinterpret_cast(ptr)); } }; } // namespace memory } // namespace paddle_mobile diff --git a/src/operators/batchnorm_op.cpp b/src/operators/batchnorm_op.cpp index f87892f1eb48f1bf155b2eefb29febeb2681da81..199c5c157ebf88a1794a61085d79facb9f4afc58 100644 --- a/src/operators/batchnorm_op.cpp +++ b/src/operators/batchnorm_op.cpp @@ -23,8 +23,8 @@ namespace operators { template void BatchNormOp::InferShape() const { - auto x_dims = param_.InputX()->dims(); - param_.OutputY()->Resize(x_dims); + auto x_dims = param_.InputX()->dims(); + param_.OutputY()->Resize(x_dims); } template class BatchNormOp; } // namespace operators diff --git a/src/operators/batchnorm_op.h b/src/operators/batchnorm_op.h index 71e1441155443995c4301af44022fca30b7e53f4..a914221d18a1748daffb2647d476f39c56c380ea 100644 --- a/src/operators/batchnorm_op.h +++ b/src/operators/batchnorm_op.h @@ -27,25 +27,25 @@ using namespace framework; template class BatchNormOp : public framework::OperatorWithKernel { - public: - BatchNormOp(const std::string &type, const VariableNameMap &inputs, - const VariableNameMap &outputs, - const framework::AttributeMap attrs, - std::shared_ptr scope) - : framework::OperatorWithKernel(type, inputs, outputs, - attrs, scope), - param_(inputs, outputs, attrs, *scope) {} - - void Run() const { - operators::BatchNormKernel kernel; - kernel.Compute(param_); - } - - using framework::OperatorWithKernel::OperatorWithKernel; - void InferShape() const override; - - protected: - BatchNormParam param_; +public: + BatchNormOp(const std::string &type, const VariableNameMap &inputs, + const VariableNameMap &outputs, + const framework::AttributeMap attrs, + std::shared_ptr scope) + : framework::OperatorWithKernel(type, inputs, outputs, attrs, + scope), + param_(inputs, outputs, attrs, *scope) {} + + void Run() const { + operators::BatchNormKernel kernel; + kernel.Compute(param_); + } + + using framework::OperatorWithKernel::OperatorWithKernel; + void InferShape() const override; + +protected: + BatchNormParam param_; }; } // namespace operators diff --git a/src/operators/concat_op.cpp b/src/operators/concat_op.cpp index a33fe39bca7430a93fff2fa6f7dc3712b3a92832..09b1f615c0dcf703e55de23adec7fd6ae4f0d533 100644 --- a/src/operators/concat_op.cpp +++ b/src/operators/concat_op.cpp @@ -23,40 +23,40 @@ namespace operators { template void ConcatOp::InferShape() const { - auto inputs = param_.Inputs(); - const size_t n = inputs.size(); + auto inputs = param_.Inputs(); + const size_t n = inputs.size(); - std::vector inputs_dims; - inputs_dims.reserve(n); - for (int i = 0; i < n; i++) { - inputs_dims.push_back(inputs[i]->dims()); - } + std::vector inputs_dims; + inputs_dims.reserve(n); + for (int i = 0; i < n; i++) { + inputs_dims.push_back(inputs[i]->dims()); + } - auto axis = static_cast(param_.Axis()); + auto axis = static_cast(param_.Axis()); - if (n == 1) { - DLOG << "Warning: concat op have only one input, " - "may waste memory"; - } + if (n == 1) { + DLOG << "Warning: concat op have only one input, " + "may waste memory"; + } - /// add all dim[axis] and check other dims if equal. - auto out_dims = inputs_dims[0]; - int in_zero_dims_size = out_dims.size(); - for (size_t i = 1; i < n; i++) { - for (size_t j = 0; j < in_zero_dims_size; j++) { - if (j == axis) { - out_dims[axis] += inputs_dims[i][j]; - } else { - assert(out_dims[j] == inputs_dims[i][j]); - } - } + /// add all dim[axis] and check other dims if equal. + auto out_dims = inputs_dims[0]; + int in_zero_dims_size = out_dims.size(); + for (size_t i = 1; i < n; i++) { + for (size_t j = 0; j < in_zero_dims_size; j++) { + if (j == axis) { + out_dims[axis] += inputs_dims[i][j]; + } else { + assert(out_dims[j] == inputs_dims[i][j]); + } } + } - if (out_dims[axis] < 0) { - out_dims[axis] = -1; - } + if (out_dims[axis] < 0) { + out_dims[axis] = -1; + } - param_.Out()->Resize(out_dims); + param_.Out()->Resize(out_dims); } template class ConcatOp; diff --git a/src/operators/concat_op.h b/src/operators/concat_op.h index 913fd3178767452baa62cb212dd572da9111cee7..57bebf1553d091c3a543878f60e8a0590f7370c2 100644 --- a/src/operators/concat_op.h +++ b/src/operators/concat_op.h @@ -26,25 +26,24 @@ using namespace framework; template class ConcatOp : public framework::OperatorWithKernel { - public: - ConcatOp(const std::string &type, const VariableNameMap &inputs, - const VariableNameMap &outputs, - const framework::AttributeMap attrs, - std::shared_ptr scope) - : framework::OperatorWithKernel(type, inputs, outputs, - attrs, scope), - param_(inputs, outputs, attrs, *scope) {} +public: + ConcatOp(const std::string &type, const VariableNameMap &inputs, + const VariableNameMap &outputs, const framework::AttributeMap attrs, + std::shared_ptr scope) + : framework::OperatorWithKernel(type, inputs, outputs, attrs, + scope), + param_(inputs, outputs, attrs, *scope) {} - void Run() const { - operators::ConcatKernel kernel; - kernel.Compute(param_); - } + void Run() const { + operators::ConcatKernel kernel; + kernel.Compute(param_); + } - using framework::OperatorWithKernel::OperatorWithKernel; - void InferShape() const override; + using framework::OperatorWithKernel::OperatorWithKernel; + void InferShape() const override; - protected: - ConcatParam param_; +protected: + ConcatParam param_; }; } // namespace operators diff --git a/src/operators/conv_op.cpp b/src/operators/conv_op.cpp index 2593dbb33bcd31e4f77c3cbaf34f437a656c0d47..27ad954e160174322b953404134c699c93531372 100644 --- a/src/operators/conv_op.cpp +++ b/src/operators/conv_op.cpp @@ -25,48 +25,48 @@ namespace operators { int ConvOutputSize(int input_size, int filter_size, int dilation, int padding, int stride) { - const int dkernel = dilation * (filter_size - 1) + 1; - int output_size = (input_size + 2 * padding - dkernel) / stride + 1; - return output_size; + const int dkernel = dilation * (filter_size - 1) + 1; + int output_size = (input_size + 2 * padding - dkernel) / stride + 1; + return output_size; } template void ConvOp::InferShape() const { - // std::cout << " begin get dims: " << std::endl; + // std::cout << " begin get dims: " << std::endl; - auto in_dims = param_.Input()->dims(); + auto in_dims = param_.Input()->dims(); - // std::cout << " end get in dims: " << std::endl; + // std::cout << " end get in dims: " << std::endl; - // std::cout << " in_dims: " << in_dims << std::endl; + // std::cout << " in_dims: " << in_dims << std::endl; - // std::cout << " begin get Filter " << std::endl; + // std::cout << " begin get Filter " << std::endl; - auto filter_dims = param_.Filter()->dims(); + auto filter_dims = param_.Filter()->dims(); - // std::cout << " end get Filter " << std::endl; + // std::cout << " end get Filter " << std::endl; - // std::cout << " begin get Attrs " << std::endl; + // std::cout << " begin get Attrs " << std::endl; - const std::vector &strides = param_.Strides(); + const std::vector &strides = param_.Strides(); - // std::cout << " end get Attrs " << strides[0] << std::endl; + // std::cout << " end get Attrs " << strides[0] << std::endl; - std::vector paddings = param_.Paddings(); + std::vector paddings = param_.Paddings(); - int groups = param_.Groups(); + int groups = param_.Groups(); - std::vector dilations = param_.Dilations(); + std::vector dilations = param_.Dilations(); - std::vector output_shape({in_dims[0], filter_dims[0]}); - for (size_t i = 0; i < strides.size(); ++i) { - output_shape.push_back(ConvOutputSize(in_dims[i + 2], - filter_dims[i + 2], dilations[i], - paddings[i], strides[i])); - } + std::vector output_shape({in_dims[0], filter_dims[0]}); + for (size_t i = 0; i < strides.size(); ++i) { + output_shape.push_back(ConvOutputSize(in_dims[i + 2], filter_dims[i + 2], + dilations[i], paddings[i], + strides[i])); + } - framework::DDim ddim = framework::make_ddim(output_shape); - param_.Output()->Resize(ddim); + framework::DDim ddim = framework::make_ddim(output_shape); + param_.Output()->Resize(ddim); } template class ConvOp; diff --git a/src/operators/conv_op.h b/src/operators/conv_op.h index b23e64197209ffcd5b4f9617b5311544bb7357fb..99b5d004d5b3e9c4ae215508ab6bc602675c4c93 100644 --- a/src/operators/conv_op.h +++ b/src/operators/conv_op.h @@ -28,25 +28,25 @@ using namespace framework; template class ConvOp : public framework::OperatorWithKernel { - public: - ConvOp(const std::string &type, const VariableNameMap &inputs, - const VariableNameMap &outputs, const framework::AttributeMap &attrs, - std::shared_ptr scope) - : framework::OperatorWithKernel(type, inputs, outputs, - attrs, scope), - param_(inputs, outputs, attrs, *scope) {} - - using framework::OperatorWithKernel::OperatorWithKernel; - void InferShape() const override; - - void Run() const { - operators::ConvKernel kernel; - kernel.Compute(param_); - this->ClearVariables({"Filter", "Input"}); - } - - private: - ConvParam param_; +public: + ConvOp(const std::string &type, const VariableNameMap &inputs, + const VariableNameMap &outputs, const framework::AttributeMap &attrs, + std::shared_ptr scope) + : framework::OperatorWithKernel(type, inputs, outputs, attrs, + scope), + param_(inputs, outputs, attrs, *scope) {} + + using framework::OperatorWithKernel::OperatorWithKernel; + void InferShape() const override; + + void Run() const { + operators::ConvKernel kernel; + kernel.Compute(param_); + this->ClearVariables({"Filter", "Input"}); + } + +private: + ConvParam param_; }; } // namespace operators diff --git a/src/operators/elementwise_add_op.cpp b/src/operators/elementwise_add_op.cpp index b09bab3058d04bac357edbfe553fe0a2c47e182d..54c0316c33e1d27114c8364a73bbd3ef8b2c92a0 100644 --- a/src/operators/elementwise_add_op.cpp +++ b/src/operators/elementwise_add_op.cpp @@ -23,8 +23,8 @@ namespace operators { template void ElementwiseAddOp::InferShape() const { - auto x_dim = param_.InputX()->dims(); - param_.Out()->Resize(x_dim); + auto x_dim = param_.InputX()->dims(); + param_.Out()->Resize(x_dim); } template class ElementwiseAddOp; } // namespace operators diff --git a/src/operators/elementwise_add_op.h b/src/operators/elementwise_add_op.h index 91de12cb2f0a64f3780dd7fa1c2f09bc471f8195..92509f098d5af686754e3797aab87d6d3626c21a 100644 --- a/src/operators/elementwise_add_op.h +++ b/src/operators/elementwise_add_op.h @@ -27,25 +27,25 @@ using namespace framework; template class ElementwiseAddOp : public framework::OperatorWithKernel { - public: - ElementwiseAddOp(const std::string &type, const VariableNameMap &inputs, - const VariableNameMap &outputs, - const framework::AttributeMap attrs, - std::shared_ptr scope) - : framework::OperatorWithKernel(type, inputs, outputs, - attrs, scope), - param_(inputs, outputs, attrs, *scope) {} +public: + ElementwiseAddOp(const std::string &type, const VariableNameMap &inputs, + const VariableNameMap &outputs, + const framework::AttributeMap attrs, + std::shared_ptr scope) + : framework::OperatorWithKernel(type, inputs, outputs, attrs, + scope), + param_(inputs, outputs, attrs, *scope) {} - void Run() const { - operators::ElementwiseAddKernel kernel; - kernel.Compute(param_); - } + void Run() const { + operators::ElementwiseAddKernel kernel; + kernel.Compute(param_); + } - using framework::OperatorWithKernel::OperatorWithKernel; - void InferShape() const override; + using framework::OperatorWithKernel::OperatorWithKernel; + void InferShape() const override; - protected: - ElementwiseAddParam param_; +protected: + ElementwiseAddParam param_; }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/arm/batchnorm_kernel.cpp b/src/operators/kernel/arm/batchnorm_kernel.cpp index e5bc7f2afd0cc5a21be5fe5a482c69251f66f465..97351c2394c0b2a88a6b7442bbd6140ee1dfbff0 100644 --- a/src/operators/kernel/arm/batchnorm_kernel.cpp +++ b/src/operators/kernel/arm/batchnorm_kernel.cpp @@ -21,73 +21,72 @@ namespace operators { template <> void BatchNormKernel::Compute(const BatchNormParam ¶m) const { - /// todo: test. - const Tensor *input_x = param.InputX(); - auto input_x_ptr = input_x->data(); - const auto &x_dims = input_x->dims(); - const int N = x_dims[0]; - const int C = x_dims[1]; - const int H = x_dims[2]; - const int W = x_dims[3]; - const int stride0 = C * H * W; - const int stride1 = H * W; - const int stride2 = W; - Tensor *out = param.OutputY(); - auto out_ptr = out->mutable_data(); - const float epsilon = param.Epsilon(); - const Tensor *mean = param.InputMean(); - const Tensor *variance = param.InputVariance(); - const Tensor *scale = param.InputScale(); - const Tensor *bias = param.InputBias(); - auto mean_ptr = mean->data(); - auto variance_ptr = variance->data(); - auto scale_ptr = scale->data(); - auto bias_ptr = bias->data(); + /// todo: test. + const Tensor *input_x = param.InputX(); + auto input_x_ptr = input_x->data(); + const auto &x_dims = input_x->dims(); + const int N = x_dims[0]; + const int C = x_dims[1]; + const int H = x_dims[2]; + const int W = x_dims[3]; + const int stride0 = C * H * W; + const int stride1 = H * W; + const int stride2 = W; + Tensor *out = param.OutputY(); + auto out_ptr = out->mutable_data(); + const float epsilon = param.Epsilon(); + const Tensor *mean = param.InputMean(); + const Tensor *variance = param.InputVariance(); + const Tensor *scale = param.InputScale(); + const Tensor *bias = param.InputBias(); + auto mean_ptr = mean->data(); + auto variance_ptr = variance->data(); + auto scale_ptr = scale->data(); + auto bias_ptr = bias->data(); - Tensor inv_std; - auto inv_std_ptr = inv_std.mutable_data(make_ddim({C})); - if (C != variance->numel()) { - std::cout << "C must equal to variance.numel()" << std::endl; - } - assert(C == variance->numel()); + Tensor inv_std; + auto inv_std_ptr = inv_std.mutable_data(make_ddim({C})); + if (C != variance->numel()) { + std::cout << "C must equal to variance.numel()" << std::endl; + } + assert(C == variance->numel()); - /// std = (var + epsilon).sqrt(); - /// inv_std = 1 / std; - for (int i = 0; i < C; i++) { - inv_std_ptr[i] = - 1 / static_cast(pow((variance_ptr[i] + epsilon), 0.5)); - } + /// std = (var + epsilon).sqrt(); + /// inv_std = 1 / std; + for (int i = 0; i < C; i++) { + inv_std_ptr[i] = + 1 / static_cast(pow((variance_ptr[i] + epsilon), 0.5)); + } - Tensor new_scale; - auto new_scale_ptr = new_scale.mutable_data(make_ddim({C})); - Tensor new_bias; - auto new_bias_ptr = new_bias.mutable_data(make_ddim({C})); + Tensor new_scale; + auto new_scale_ptr = new_scale.mutable_data(make_ddim({C})); + Tensor new_bias; + auto new_bias_ptr = new_bias.mutable_data(make_ddim({C})); - /// ((x - est_mean) * (inv_var) * scale + bias equal to - /// (x * inv_var * scale) + (bias - est_mean * inv_var * scale) - for (int i = 0; i < C; i++) { - new_scale_ptr[i] = inv_std_ptr[i] * scale_ptr[i]; - new_bias_ptr[i] = - bias_ptr[i] - mean_ptr[i] * inv_std_ptr[i] * scale_ptr[i]; - { - for (int n = 0; n < N; n++) { - for (int h = 0; h < H; h++) { - for (int w = 0; w < W; w++) { - int index = n * stride0 + i * stride1 + h * stride2 + w; - out_ptr[index] = input_x_ptr[index] * new_scale_ptr[i] + - new_bias_ptr[i]; - } - } - } + /// ((x - est_mean) * (inv_var) * scale + bias equal to + /// (x * inv_var * scale) + (bias - est_mean * inv_var * scale) + for (int i = 0; i < C; i++) { + new_scale_ptr[i] = inv_std_ptr[i] * scale_ptr[i]; + new_bias_ptr[i] = bias_ptr[i] - mean_ptr[i] * inv_std_ptr[i] * scale_ptr[i]; + { + for (int n = 0; n < N; n++) { + for (int h = 0; h < H; h++) { + for (int w = 0; w < W; w++) { + int index = n * stride0 + i * stride1 + h * stride2 + w; + out_ptr[index] = + input_x_ptr[index] * new_scale_ptr[i] + new_bias_ptr[i]; + } } + } } - DLOG << "input[2,5,1,0](input[102]) ,channel 5 :"; - DLOG << "input_x_ptr : " << input_x_ptr[102]; - DLOG << "variance : " << variance_ptr[5]; - DLOG << "inv_std_ptr : " << inv_std_ptr[5]; - DLOG << "new_scale_ptr : " << new_scale_ptr[5]; - DLOG << "new_bias_ptr : " << new_bias_ptr[5]; - DLOG << "out_ptr : " << out_ptr[102]; + } + DLOG << "input[2,5,1,0](input[102]) ,channel 5 :"; + DLOG << "input_x_ptr : " << input_x_ptr[102]; + DLOG << "variance : " << variance_ptr[5]; + DLOG << "inv_std_ptr : " << inv_std_ptr[5]; + DLOG << "new_scale_ptr : " << new_scale_ptr[5]; + DLOG << "new_bias_ptr : " << new_bias_ptr[5]; + DLOG << "out_ptr : " << out_ptr[102]; } } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/arm/concat_kernel.cpp b/src/operators/kernel/arm/concat_kernel.cpp index da650cee275a768e90729f69d1cca42f6abe853f..3806cbeea7c35d7286757494da74062d284fc27e 100644 --- a/src/operators/kernel/arm/concat_kernel.cpp +++ b/src/operators/kernel/arm/concat_kernel.cpp @@ -19,36 +19,36 @@ limitations under the License. */ namespace paddle_mobile { namespace operators { template class ConcatFunctor { - public: - void operator()(const std::vector &input, const int axis, - framework::Tensor *output) { - size_t num = input.size(); - int rows = 1; - auto dim_0 = input[0].dims(); - for (int i = 0; i < axis; ++i) { - rows *= dim_0[i]; - } - int out_rows = rows, out_cols = 0; +public: + void operator()(const std::vector &input, const int axis, + framework::Tensor *output) { + size_t num = input.size(); + int rows = 1; + auto dim_0 = input[0].dims(); + for (int i = 0; i < axis; ++i) { + rows *= dim_0[i]; + } + int out_rows = rows, out_cols = 0; - std::vector input_cols(input.size()); - for (int i = 0; i < num; ++i) { - int t_cols = input[i].numel() / rows; - out_cols += t_cols; - input_cols[i] = t_cols; - } + std::vector input_cols(input.size()); + for (int i = 0; i < num; ++i) { + int t_cols = input[i].numel() / rows; + out_cols += t_cols; + input_cols[i] = t_cols; + } - // computation - for (int k = 0; k < out_rows; ++k) { - T *dst_ptr = output->data() + k * out_cols; - int col_idx = 0; - for (int j = 0; j < num; ++j) { - int col_len = input_cols[j]; - const T *src_prt = input[j].data() + k * col_len; - memory::Copy(dst_ptr + col_idx, src_prt, sizeof(T) * col_len); - col_idx += col_len; - } - } + // computation + for (int k = 0; k < out_rows; ++k) { + T *dst_ptr = output->data() + k * out_cols; + int col_idx = 0; + for (int j = 0; j < num; ++j) { + int col_len = input_cols[j]; + const T *src_prt = input[j].data() + k * col_len; + memory::Copy(dst_ptr + col_idx, src_prt, sizeof(T) * col_len); + col_idx += col_len; + } } + } }; template void StridedNumelCopyWithAxis(int64_t axis, T *dst, @@ -56,61 +56,60 @@ void StridedNumelCopyWithAxis(int64_t axis, T *dst, const T *src, const framework::DDim &src_stride_numel, int64_t size) { - int64_t before = dst_stride_numel[0] / dst_stride_numel[axis]; - int64_t src_after = src_stride_numel[axis]; - int64_t dst_after = dst_stride_numel[axis]; + int64_t before = dst_stride_numel[0] / dst_stride_numel[axis]; + int64_t src_after = src_stride_numel[axis]; + int64_t dst_after = dst_stride_numel[axis]; - ///"src and dst tensor should have the same dims size." - assert(src_stride_numel.size() == dst_stride_numel.size()); + ///"src and dst tensor should have the same dims size." + assert(src_stride_numel.size() == dst_stride_numel.size()); - for (int64_t i = 0; i < axis; ++i) { - if (i < axis) { - /// src and dst should have the same elements - /// except the specified axis. - assert(src_stride_numel[i] / src_stride_numel[axis] == - dst_stride_numel[i] / dst_stride_numel[axis]); + for (int64_t i = 0; i < axis; ++i) { + if (i < axis) { + /// src and dst should have the same elements + /// except the specified axis. + assert(src_stride_numel[i] / src_stride_numel[axis] == + dst_stride_numel[i] / dst_stride_numel[axis]); - } else if (i == axis) { - continue; - } else { - /// "src and dst should have the same elements " - /// "except the specified axis." - assert(src_stride_numel[i] == dst_stride_numel[i]); - } + } else if (i == axis) { + continue; + } else { + /// "src and dst should have the same elements " + /// "except the specified axis." + assert(src_stride_numel[i] == dst_stride_numel[i]); } + } - for (int64_t i = 0; i < before; ++i) { - memory::Copy(dst + i * dst_after, src + i * src_after, - sizeof(T) * size); - } + for (int64_t i = 0; i < before; ++i) { + memory::Copy(dst + i * dst_after, src + i * src_after, sizeof(T) * size); + } } template <> void ConcatKernel::Compute(const ConcatParam ¶m) const { - auto inputs = param.Inputs(); - auto *out = param.Out(); - int64_t axis = param.Axis(); - out->mutable_data(); + auto inputs = param.Inputs(); + auto *out = param.Out(); + int64_t axis = param.Axis(); + out->mutable_data(); - /// Sometimes direct copies will be faster, this maybe need deeply analysis. - if (axis == 0 && inputs.size() < 10) { - size_t output_offset = 0; - for (auto *in : inputs) { - auto in_stride = framework::stride_numel(in->dims()); - auto out_stride = framework::stride_numel(out->dims()); - StridedNumelCopyWithAxis( - axis, out->data() + output_offset, out_stride, - in->data(), in_stride, in_stride[axis]); - output_offset += in_stride[axis]; - } - } else { - std::vector inputs_concat(inputs.size()); - for (int j = 0; j < inputs.size(); ++j) { - inputs_concat[j] = *inputs[j]; - } - ConcatFunctor concat_functor; - concat_functor(inputs_concat, static_cast(axis), out); + /// Sometimes direct copies will be faster, this maybe need deeply analysis. + if (axis == 0 && inputs.size() < 10) { + size_t output_offset = 0; + for (auto *in : inputs) { + auto in_stride = framework::stride_numel(in->dims()); + auto out_stride = framework::stride_numel(out->dims()); + StridedNumelCopyWithAxis(axis, out->data() + output_offset, + out_stride, in->data(), in_stride, + in_stride[axis]); + output_offset += in_stride[axis]; + } + } else { + std::vector inputs_concat(inputs.size()); + for (int j = 0; j < inputs.size(); ++j) { + inputs_concat[j] = *inputs[j]; } + ConcatFunctor concat_functor; + concat_functor(inputs_concat, static_cast(axis), out); + } } } // namespace operators diff --git a/src/operators/kernel/arm/conv_kernel.cpp b/src/operators/kernel/arm/conv_kernel.cpp index 96f0bcd8b14fc26452bd93765dc82044922519d5..16c944b93b403fb0a855c22de2fd48a18834bcf3 100644 --- a/src/operators/kernel/arm/conv_kernel.cpp +++ b/src/operators/kernel/arm/conv_kernel.cpp @@ -24,128 +24,126 @@ namespace operators { bool IsExpand(const std::vector &filter_dim, const std::vector &strides, const std::vector &paddings, const std::vector &dilations) { - bool filter_1 = true, strides_1 = true, padding_0 = true, dilation_1 = true; - for (size_t j = 0; j < strides.size(); ++j) { - filter_1 = filter_1 && (static_cast(filter_dim[j + 2]) == 1); - strides_1 = strides_1 && (strides[j] == 1); - padding_0 = padding_0 && (paddings[j] == 0); - dilation_1 = dilation_1 && (dilations[j] == 1); - } - return !(filter_1 && strides_1 && padding_0 && dilation_1); + bool filter_1 = true, strides_1 = true, padding_0 = true, dilation_1 = true; + for (size_t j = 0; j < strides.size(); ++j) { + filter_1 = filter_1 && (static_cast(filter_dim[j + 2]) == 1); + strides_1 = strides_1 && (strides[j] == 1); + padding_0 = padding_0 && (paddings[j] == 0); + dilation_1 = dilation_1 && (dilations[j] == 1); + } + return !(filter_1 && strides_1 && padding_0 && dilation_1); } template <> void ConvKernel::Compute(const ConvParam ¶m) const { - LOG(kLOG_DEBUG) << param; - - const Tensor *input = param.Input(); - - // The filter will be reshaped in the calculations, - // so here use an assignment operation, - // that avoids modifying the variable in the Scope. - Tensor filter = *param.Filter(); - - Tensor *output = param.Output(); - // output->mutable_data(context.GetPlace()); - - int groups = param.Groups(); - std::vector strides = param.Strides(); - std::vector paddings = param.Paddings(); - std::vector dilations = param.Dilations(); - - DLOG << " compute end get Attrs " << strides[0]; - - const int batch_size = static_cast(input->dims()[0]); - - // filter_shape_vec: {k_o, k_i, k_h, k_w} or {k_o, k_i, k_d, k_h, - // k_w} - std::vector filter_shape_vec(framework::vectorize(filter.dims())); - // output_shape_vec: {o_n, o_c, o_h, o_w} or {o_n, o_c, o_d, o_h, - // o_w} - std::vector output_shape_vec(framework::vectorize(output->dims())); - - // use col_shape in the im2col calculation - // col_shape_vec: {i_c/g, k_h, k_w, o_h, o_w} or {i_c/g, k_d, k_h, - // k_w, o_d, - // o_h, o_w} - size_t data_dim = filter_shape_vec.size() - 2; - std::vector col_shape_vec(1 + 2 * data_dim); - col_shape_vec[0] = input->dims()[1] / groups; - for (size_t j = 0; j < data_dim; ++j) { - col_shape_vec[j + 1] = filter_shape_vec[j + 2]; - col_shape_vec[j + 1 + data_dim] = output_shape_vec[j + 2]; - } - framework::DDim col_shape(framework::make_ddim(col_shape_vec)); - - // use col_matrix_shape in the gemm calculation - // size: (i_c/g * k_h * k_w, o_h * o_w) or (i_c/g * k_d * k_h * k_w, - // o_d * - // o_h * o_w) - framework::DDim col_matrix_shape = - framework::flatten_to_2d(col_shape, data_dim + 1); - - bool is_expand = IsExpand(filter_shape_vec, strides, paddings, dilations); - Tensor col; - // col_matrix shares the same piece of data with col, - // but will be reshaped into a two-dimensional matrix shape - // to call the matrix multiplication interface. - Tensor col_matrix; - if (is_expand) { - col.mutable_data(col_shape); + LOG(kLOG_DEBUG) << param; + + const Tensor *input = param.Input(); + + // The filter will be reshaped in the calculations, + // so here use an assignment operation, + // that avoids modifying the variable in the Scope. + Tensor filter = *param.Filter(); + + Tensor *output = param.Output(); + // output->mutable_data(context.GetPlace()); + + int groups = param.Groups(); + std::vector strides = param.Strides(); + std::vector paddings = param.Paddings(); + std::vector dilations = param.Dilations(); + + DLOG << " compute end get Attrs " << strides[0]; + + const int batch_size = static_cast(input->dims()[0]); + + // filter_shape_vec: {k_o, k_i, k_h, k_w} or {k_o, k_i, k_d, k_h, + // k_w} + std::vector filter_shape_vec(framework::vectorize(filter.dims())); + // output_shape_vec: {o_n, o_c, o_h, o_w} or {o_n, o_c, o_d, o_h, + // o_w} + std::vector output_shape_vec(framework::vectorize(output->dims())); + + // use col_shape in the im2col calculation + // col_shape_vec: {i_c/g, k_h, k_w, o_h, o_w} or {i_c/g, k_d, k_h, + // k_w, o_d, + // o_h, o_w} + size_t data_dim = filter_shape_vec.size() - 2; + std::vector col_shape_vec(1 + 2 * data_dim); + col_shape_vec[0] = input->dims()[1] / groups; + for (size_t j = 0; j < data_dim; ++j) { + col_shape_vec[j + 1] = filter_shape_vec[j + 2]; + col_shape_vec[j + 1 + data_dim] = output_shape_vec[j + 2]; + } + framework::DDim col_shape(framework::make_ddim(col_shape_vec)); + + // use col_matrix_shape in the gemm calculation + // size: (i_c/g * k_h * k_w, o_h * o_w) or (i_c/g * k_d * k_h * k_w, + // o_d * + // o_h * o_w) + framework::DDim col_matrix_shape = + framework::flatten_to_2d(col_shape, data_dim + 1); + + bool is_expand = IsExpand(filter_shape_vec, strides, paddings, dilations); + Tensor col; + // col_matrix shares the same piece of data with col, + // but will be reshaped into a two-dimensional matrix shape + // to call the matrix multiplication interface. + Tensor col_matrix; + if (is_expand) { + col.mutable_data(col_shape); + col_matrix.ShareDataWith(col); + col_matrix.Resize(col_matrix_shape); + } + + framework::DDim input_shape = framework::slice_ddim( + input->dims(), 1, static_cast(input->dims().size())); + + framework::DDim filter_matrix_shape = {filter.dims()[0], + filter.numel() / filter.dims()[0]}; + filter.Resize(filter_matrix_shape); + + framework::DDim output_matrix_shape = { + output->dims()[1], + output->numel() / (output->dims()[0] * output->dims()[1])}; + + // convolution operator: im2col(or vol2col) + gemm + int in_step = static_cast(input->dims()[1]) / groups; + int out_step = static_cast(output->dims()[1]) / groups; + + math::Vol2ColFunctor vol2col; + math::Im2ColFunctor im2col; + + // auto& dev_ctx = context.template + // device_context(); + for (int i = 0; i < batch_size; i++) { + Tensor in_batch = input->Slice(i, i + 1).Resize(input_shape); + Tensor out_batch = output->Slice(i, i + 1).Resize(output_matrix_shape); + + for (int g = 0; g < groups; g++) { + Tensor in_slice = in_batch.Slice(g * in_step, (g + 1) * in_step); + + if (!is_expand) { + col.ShareDataWith(in_slice); col_matrix.ShareDataWith(col); col_matrix.Resize(col_matrix_shape); + } else if (data_dim == 2U) { + // im2col + im2col(in_slice, dilations, strides, + std::vector{paddings[0], paddings[1], paddings[0], + paddings[1]}, + &col); + } else if (data_dim == 3U) { + // vol2col + vol2col(in_slice, dilations, strides, paddings, &col); + } + + // gemm + Tensor out_slice = out_batch.Slice(g * out_step, (g + 1) * out_step); + Tensor filter_slice = filter.Slice(g * out_step, (g + 1) * out_step); + math::matmul(filter_slice, false, col_matrix, false, float(1.0), + &out_slice, float(0.0)); } - - framework::DDim input_shape = framework::slice_ddim( - input->dims(), 1, static_cast(input->dims().size())); - - framework::DDim filter_matrix_shape = {filter.dims()[0], - filter.numel() / filter.dims()[0]}; - filter.Resize(filter_matrix_shape); - - framework::DDim output_matrix_shape = { - output->dims()[1], - output->numel() / (output->dims()[0] * output->dims()[1])}; - - // convolution operator: im2col(or vol2col) + gemm - int in_step = static_cast(input->dims()[1]) / groups; - int out_step = static_cast(output->dims()[1]) / groups; - - math::Vol2ColFunctor vol2col; - math::Im2ColFunctor im2col; - - // auto& dev_ctx = context.template - // device_context(); - for (int i = 0; i < batch_size; i++) { - Tensor in_batch = input->Slice(i, i + 1).Resize(input_shape); - Tensor out_batch = output->Slice(i, i + 1).Resize(output_matrix_shape); - - for (int g = 0; g < groups; g++) { - Tensor in_slice = in_batch.Slice(g * in_step, (g + 1) * in_step); - - if (!is_expand) { - col.ShareDataWith(in_slice); - col_matrix.ShareDataWith(col); - col_matrix.Resize(col_matrix_shape); - } else if (data_dim == 2U) { - // im2col - im2col(in_slice, dilations, strides, - std::vector{paddings[0], paddings[1], paddings[0], - paddings[1]}, - &col); - } else if (data_dim == 3U) { - // vol2col - vol2col(in_slice, dilations, strides, paddings, &col); - } - - // gemm - Tensor out_slice = - out_batch.Slice(g * out_step, (g + 1) * out_step); - Tensor filter_slice = - filter.Slice(g * out_step, (g + 1) * out_step); - math::matmul(filter_slice, false, col_matrix, false, - float(1.0), &out_slice, float(0.0)); - } - } + } } template class ConvKernel; diff --git a/src/operators/kernel/arm/elementwise_add_kernel.cpp b/src/operators/kernel/arm/elementwise_add_kernel.cpp index fa183a1f1a7c3065cba81aecbb7a2dfb614b9f12..9ae34fe170f76dea149ced01aa0a27fd904042b1 100644 --- a/src/operators/kernel/arm/elementwise_add_kernel.cpp +++ b/src/operators/kernel/arm/elementwise_add_kernel.cpp @@ -20,19 +20,19 @@ namespace paddle_mobile { namespace operators { template struct AddFunctor { - inline T operator()(T a, T b) const { return a + b; } + inline T operator()(T a, T b) const { return a + b; } }; template <> void ElementwiseAddKernel::Compute( const ElementwiseAddParam ¶m) const { - const Tensor *input_x = param.InputX(); - const Tensor *input_y = param.InputY(); - Tensor *Out = param.Out(); - Out->mutable_data(); - const int axis = param.Axis(); - ElementwiseComputeEx, float>(input_x, input_y, axis, - AddFunctor(), Out); + const Tensor *input_x = param.InputX(); + const Tensor *input_y = param.InputY(); + Tensor *Out = param.Out(); + Out->mutable_data(); + const int axis = param.Axis(); + ElementwiseComputeEx, float>(input_x, input_y, axis, + AddFunctor(), Out); } template class ElementwiseAddKernel; diff --git a/src/operators/kernel/arm/lrn_kernel.cpp b/src/operators/kernel/arm/lrn_kernel.cpp index e4d4c06350554c3d003533a12c5bf92b55a695a6..bc9c871afd122a7389081409bc7e5d042dcb7c1d 100644 --- a/src/operators/kernel/arm/lrn_kernel.cpp +++ b/src/operators/kernel/arm/lrn_kernel.cpp @@ -24,21 +24,21 @@ namespace paddle_mobile { namespace operators { template <> void LrnKernel::Compute(const LrnParam ¶m) const { - const Tensor *input_x = param.InputX(); - auto x_dims = input_x->dims(); - /// data_format = NCHW - const int N = x_dims[0]; - const int C = x_dims[1]; - const int H = x_dims[2]; - const int W = x_dims[3]; - Tensor *out = param.Out(); - out->mutable_data(); - const int n = param.N(); - const float alpha = param.Alpha(); - const float beta = param.Beta(); - const float k = param.K(); - LRNFunctor lrnFunctor; - lrnFunctor(*input_x, out, N, C, H, W, n, k, alpha, beta); + const Tensor *input_x = param.InputX(); + auto x_dims = input_x->dims(); + /// data_format = NCHW + const int N = x_dims[0]; + const int C = x_dims[1]; + const int H = x_dims[2]; + const int W = x_dims[3]; + Tensor *out = param.Out(); + out->mutable_data(); + const int n = param.N(); + const float alpha = param.Alpha(); + const float beta = param.Beta(); + const float k = param.K(); + LRNFunctor lrnFunctor; + lrnFunctor(*input_x, out, N, C, H, W, n, k, alpha, beta); } template class LrnKernel; diff --git a/src/operators/kernel/arm/mul_kernel.cpp b/src/operators/kernel/arm/mul_kernel.cpp index c500d7aff74bb58e6b2f5106949ebcd201de80d5..abd5d4d5fccefeb6fcf04fea4af610ae87a4253e 100644 --- a/src/operators/kernel/arm/mul_kernel.cpp +++ b/src/operators/kernel/arm/mul_kernel.cpp @@ -24,27 +24,27 @@ namespace paddle_mobile { namespace operators { template <> void MulKernel::Compute(const MulParam ¶m) const { - const Tensor *input_x = param.InputX(); - const Tensor *input_y = param.InputY(); - Tensor *out = param.Out(); - out->mutable_data(); - const Tensor x_matrix = - input_x->dims().size() > 2 - ? framework::ReshapeToMatrix(*input_x, param.XNumColDims()) - : *input_x; - const Tensor y_matrix = - input_y->dims().size() > 2 - ? framework::ReshapeToMatrix(*input_y, param.YNumColDims()) - : *input_y; - auto out_dim = out->dims(); - if (out_dim.size() != 2) { - out->Resize({x_matrix.dims()[0], y_matrix.dims()[1]}); - } - math::matmul(x_matrix, false, y_matrix, false, static_cast(1), - out, static_cast(0)); - if (out_dim.size() != 2) { - out->Resize(out_dim); - } + const Tensor *input_x = param.InputX(); + const Tensor *input_y = param.InputY(); + Tensor *out = param.Out(); + out->mutable_data(); + const Tensor x_matrix = + input_x->dims().size() > 2 + ? framework::ReshapeToMatrix(*input_x, param.XNumColDims()) + : *input_x; + const Tensor y_matrix = + input_y->dims().size() > 2 + ? framework::ReshapeToMatrix(*input_y, param.YNumColDims()) + : *input_y; + auto out_dim = out->dims(); + if (out_dim.size() != 2) { + out->Resize({x_matrix.dims()[0], y_matrix.dims()[1]}); + } + math::matmul(x_matrix, false, y_matrix, false, static_cast(1), + out, static_cast(0)); + if (out_dim.size() != 2) { + out->Resize(out_dim); + } } template class MulKernel; diff --git a/src/operators/kernel/arm/pool_kernel.cpp b/src/operators/kernel/arm/pool_kernel.cpp index 34e17b671a101e4e72d52c7ff6ee0cb3ca9d4528..6678e468d7fc08ea99819b507a6a32e416645160 100644 --- a/src/operators/kernel/arm/pool_kernel.cpp +++ b/src/operators/kernel/arm/pool_kernel.cpp @@ -24,54 +24,54 @@ namespace operators { inline void PoolBasic(std::string pooling_type, std::vector ksize, std::vector strides, std::vector paddings, const Tensor *in_x, Tensor *out) { - if (pooling_type == "max") { - math::PoolFunctor, float> pool2d_forward; - math::MaxPool pool_process; - pool2d_forward(*in_x, ksize, strides, paddings, pool_process, out); + if (pooling_type == "max") { + math::PoolFunctor, float> pool2d_forward; + math::MaxPool pool_process; + pool2d_forward(*in_x, ksize, strides, paddings, pool_process, out); - } else if (pooling_type == "avg") { - math::PoolFunctor, float> pool2d_forward; - math::AvgPool pool_process; - pool2d_forward(*in_x, ksize, strides, paddings, pool_process, out); - } + } else if (pooling_type == "avg") { + math::PoolFunctor, float> pool2d_forward; + math::AvgPool pool_process; + pool2d_forward(*in_x, ksize, strides, paddings, pool_process, out); + } } template <> void PoolKernel::Compute(const PoolParam ¶m) const { - const Tensor *in_x = param.Input(); - Tensor *out = param.Output(); - std::string pooling_type = param.PoolingType(); + const Tensor *in_x = param.Input(); + Tensor *out = param.Output(); + std::string pooling_type = param.PoolingType(); - std::vector ksize = param.Ksize(); + std::vector ksize = param.Ksize(); - std::vector strides = param.Strides(); + std::vector strides = param.Strides(); - std::vector paddings = param.Paddings(); - if (ksize.size() != 2) { - LOG(paddle_mobile::LogLevel::kLOG_ERROR) - << "Pool op only supports 2D and 3D input."; - } + std::vector paddings = param.Paddings(); + if (ksize.size() != 2) { + LOG(paddle_mobile::LogLevel::kLOG_ERROR) + << "Pool op only supports 2D and 3D input."; + } - if (param.isGlobalPooling()) { - for (size_t i = 0; i < ksize.size(); ++i) { - paddings[i] = 0; - ksize[i] = static_cast(in_x->dims()[i + 2]); - } + if (param.isGlobalPooling()) { + for (size_t i = 0; i < ksize.size(); ++i) { + paddings[i] = 0; + ksize[i] = static_cast(in_x->dims()[i + 2]); } + } - PoolBasic(pooling_type, ksize, strides, paddings, in_x, out); + PoolBasic(pooling_type, ksize, strides, paddings, in_x, out); - // if (param.isGlobalPooling() || ksize[0] != ksize[1] || - // strides[0] != strides[1] || strides[1] != 2 || - // paddings[0] != paddings[1] || paddings[1] > 1) { - // PoolBasic(pooling_type, ksize, strides, paddings, in_x, out); - // - // } else if (ksize[0] == 2) { - // - // } else if (ksize[0] == 3) { - // - // } else { - // PoolBasic(pooling_type, ksize, strides, paddings, in_x, out); - // } + // if (param.isGlobalPooling() || ksize[0] != ksize[1] || + // strides[0] != strides[1] || strides[1] != 2 || + // paddings[0] != paddings[1] || paddings[1] > 1) { + // PoolBasic(pooling_type, ksize, strides, paddings, in_x, out); + // + // } else if (ksize[0] == 2) { + // + // } else if (ksize[0] == 3) { + // + // } else { + // PoolBasic(pooling_type, ksize, strides, paddings, in_x, out); + // } } } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/batchnorm_kernel.h b/src/operators/kernel/batchnorm_kernel.h index f4518d0c6159d39b134f9fe2c70a215c61ea7d68..4434c162834ed0b04df138fba0159feda9f7624a 100644 --- a/src/operators/kernel/batchnorm_kernel.h +++ b/src/operators/kernel/batchnorm_kernel.h @@ -28,8 +28,8 @@ using namespace framework; template class BatchNormKernel : public framework::OpKernelBase { - public: - void Compute(const BatchNormParam ¶m) const; +public: + void Compute(const BatchNormParam ¶m) const; }; } // namespace operators diff --git a/src/operators/kernel/concat_kernel.h b/src/operators/kernel/concat_kernel.h index 0580994a178bd3e976a459e9aaaae10079551b9c..9672ff6ab7128f10d6cdcde3c73f8bdcc3b71003 100644 --- a/src/operators/kernel/concat_kernel.h +++ b/src/operators/kernel/concat_kernel.h @@ -26,8 +26,8 @@ using namespace framework; template class ConcatKernel : public framework::OpKernelBase { - public: - void Compute(const ConcatParam ¶m) const; +public: + void Compute(const ConcatParam ¶m) const; }; } // namespace operators diff --git a/src/operators/kernel/conv_kernel.h b/src/operators/kernel/conv_kernel.h index 5f184ed63b66fa99383a251f48242cba68ae3325..c1043f5ffdbd66690cbf4dae150379415c5b0aa3 100644 --- a/src/operators/kernel/conv_kernel.h +++ b/src/operators/kernel/conv_kernel.h @@ -31,8 +31,8 @@ using namespace framework; template class ConvKernel : public framework::OpKernelBase { - public: - void Compute(const ConvParam ¶m) const; +public: + void Compute(const ConvParam ¶m) const; }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/elementwise_add_kernel.h b/src/operators/kernel/elementwise_add_kernel.h index 01b967af1da555843806418aebfcdfbac7e71fc8..e542268a94a598578da746ab703a8ac80d0df1ed 100644 --- a/src/operators/kernel/elementwise_add_kernel.h +++ b/src/operators/kernel/elementwise_add_kernel.h @@ -29,8 +29,8 @@ using namespace framework; template class ElementwiseAddKernel : public framework::OpKernelBase { - public: - void Compute(const ElementwiseAddParam ¶m) const; +public: + void Compute(const ElementwiseAddParam ¶m) const; }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/lrn_kernel.h b/src/operators/kernel/lrn_kernel.h index b096a6640e048fb1b88fe096aecb64ff0906ca0f..8f7469377095379eea6ffe2ff9b0cb4c8e03905f 100644 --- a/src/operators/kernel/lrn_kernel.h +++ b/src/operators/kernel/lrn_kernel.h @@ -26,52 +26,49 @@ namespace operators { using namespace framework; template struct LRNFunctor { - void operator()(const framework::Tensor &input, framework::Tensor *out, - int N, int C, int H, int W, int n, T k, T alpha, T beta) { - auto input_ptr = input.data(); - const int start = -(n - 1) / 2; - const int end = start + n; + void operator()(const framework::Tensor &input, framework::Tensor *out, int N, + int C, int H, int W, int n, T k, T alpha, T beta) { + auto input_ptr = input.data(); + const int start = -(n - 1) / 2; + const int end = start + n; - const int stride0 = C * H * W; - const int stride1 = H * W; - const int stride2 = W; - const int stride3 = 1; + const int stride0 = C * H * W; + const int stride1 = H * W; + const int stride2 = W; + const int stride3 = 1; - framework::Tensor sqr_buffer; - auto sqr_buffer_ptr = sqr_buffer.mutable_data(input.dims()); - std::fill(sqr_buffer_ptr, sqr_buffer_ptr + sqr_buffer.numel(), k); - for (int a = 0; a < N; a++) { - for (int b = 0; b < C; b++) { - for (int index = start; index < end; index++) { - int channel = b + index; - if (channel >= 0 && channel < C) { - for (int c = 0; c < H; c++) { - for (int d = 0; d < W; d++) { - int u = - a * stride0 + b * stride1 + c * stride2 + d; + framework::Tensor sqr_buffer; + auto sqr_buffer_ptr = sqr_buffer.mutable_data(input.dims()); + std::fill(sqr_buffer_ptr, sqr_buffer_ptr + sqr_buffer.numel(), k); + for (int a = 0; a < N; a++) { + for (int b = 0; b < C; b++) { + for (int index = start; index < end; index++) { + int channel = b + index; + if (channel >= 0 && channel < C) { + for (int c = 0; c < H; c++) { + for (int d = 0; d < W; d++) { + int u = a * stride0 + b * stride1 + c * stride2 + d; - int i = a * stride0 + channel * stride1 + - c * stride2 + d; + int i = a * stride0 + channel * stride1 + c * stride2 + d; - sqr_buffer_ptr[u] += - alpha * input_ptr[i] * input_ptr[i]; - } - } - } - } + sqr_buffer_ptr[u] += alpha * input_ptr[i] * input_ptr[i]; + } } + } } - auto out_ptr = out->data(); - for (int i = 0; i < input.numel(); i++) { - out_ptr[i] = input_ptr[i] / pow(sqr_buffer_ptr[i], beta); - } + } + } + auto out_ptr = out->data(); + for (int i = 0; i < input.numel(); i++) { + out_ptr[i] = input_ptr[i] / pow(sqr_buffer_ptr[i], beta); } + } }; template class LrnKernel : public framework::OpKernelBase { - public: - void Compute(const LrnParam ¶m) const; +public: + void Compute(const LrnParam ¶m) const; }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/mul_kernel.h b/src/operators/kernel/mul_kernel.h index 0ae16d2e25dd61c97bcd5a6751ad2d224b1c10d1..2f29bc04a774f97f378e004bf9d589f492040236 100644 --- a/src/operators/kernel/mul_kernel.h +++ b/src/operators/kernel/mul_kernel.h @@ -28,8 +28,8 @@ using namespace framework; template class MulKernel : public framework::OpKernelBase { - public: - void Compute(const MulParam ¶m) const; +public: + void Compute(const MulParam ¶m) const; }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/pool_kernel.h b/src/operators/kernel/pool_kernel.h index 6b3decd76fc9344dfb1f35f1116133ad78d6a183..aa763ea45e7d952a498f4f0726067efb0c0992bf 100644 --- a/src/operators/kernel/pool_kernel.h +++ b/src/operators/kernel/pool_kernel.h @@ -28,8 +28,8 @@ using namespace framework; template class PoolKernel : public framework::OpKernelBase { - public: - void Compute(const PoolParam ¶m) const; +public: + void Compute(const PoolParam ¶m) const; }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/lrn_op.cpp b/src/operators/lrn_op.cpp index 601d3a8c16c5af738fc2d54f30021ba66136e0a3..e9d52e0be65da39cc4cc0dec5b68170b88987dd1 100644 --- a/src/operators/lrn_op.cpp +++ b/src/operators/lrn_op.cpp @@ -22,8 +22,8 @@ namespace paddle_mobile { namespace operators { template void LrnOp::InferShape() const { - auto x_dims = param_.InputX()->dims(); - param_.Out()->Resize(x_dims); + auto x_dims = param_.InputX()->dims(); + param_.Out()->Resize(x_dims); } template class LrnOp; } // namespace operators diff --git a/src/operators/lrn_op.h b/src/operators/lrn_op.h index a774f829b8dec12c644b0a84d0f01ee697ab48d9..b65da61089e5d50f5e66a8515a91d5e9259fd85f 100644 --- a/src/operators/lrn_op.h +++ b/src/operators/lrn_op.h @@ -27,24 +27,24 @@ using namespace framework; template class LrnOp : public framework::OperatorWithKernel { - public: - LrnOp(const std::string &type, const VariableNameMap &inputs, - const VariableNameMap &outputs, const framework::AttributeMap attrs, - std::shared_ptr scope) - : framework::OperatorWithKernel(type, inputs, outputs, - attrs, scope), - param_(inputs, outputs, attrs, *scope) {} - - void Run() const { - operators::LrnKernel kernel; - kernel.Compute(param_); - } - - using framework::OperatorWithKernel::OperatorWithKernel; - void InferShape() const override; - - protected: - LrnParam param_; +public: + LrnOp(const std::string &type, const VariableNameMap &inputs, + const VariableNameMap &outputs, const framework::AttributeMap attrs, + std::shared_ptr scope) + : framework::OperatorWithKernel(type, inputs, outputs, attrs, + scope), + param_(inputs, outputs, attrs, *scope) {} + + void Run() const { + operators::LrnKernel kernel; + kernel.Compute(param_); + } + + using framework::OperatorWithKernel::OperatorWithKernel; + void InferShape() const override; + +protected: + LrnParam param_; }; } // namespace operators diff --git a/src/operators/math/elementwise_op_function.h b/src/operators/math/elementwise_op_function.h index 8a35572bb0984338fbeee622ae11586087ffd129..3ff20cdc04380b08e5ff64bbda69cd9df056eb93 100644 --- a/src/operators/math/elementwise_op_function.h +++ b/src/operators/math/elementwise_op_function.h @@ -34,66 +34,66 @@ namespace operators { inline void get_mid_dims(const framework::DDim &x_dims, const framework::DDim &y_dims, const int axis, int *pre, int *n, int *post) { - *pre = 1; - *n = 1; - *post = 1; - // compute pre - for (int i = 0; i < axis; ++i) { - (*pre) *= x_dims[i]; - } - - for (int i = 0; i < y_dims.size(); ++i) { - assert(x_dims[i + axis] == y_dims[i]); - /// "Broadcast dimension mismatch."); - (*n) *= y_dims[i]; - } - - for (int i = axis + y_dims.size(); i < x_dims.size(); ++i) { - (*post) *= x_dims[i]; - } + *pre = 1; + *n = 1; + *post = 1; + // compute pre + for (int i = 0; i < axis; ++i) { + (*pre) *= x_dims[i]; + } + + for (int i = 0; i < y_dims.size(); ++i) { + assert(x_dims[i + axis] == y_dims[i]); + /// "Broadcast dimension mismatch."); + (*n) *= y_dims[i]; + } + + for (int i = axis + y_dims.size(); i < x_dims.size(); ++i) { + (*post) *= x_dims[i]; + } } /// remove dims tail 1. (4,20,1,1) -> (4,20) inline void trim_trailing_singular_dims(framework::DDim *dims) { - // Remove trailing dimensions of size 1 for y - auto actual_dims_size = dims->size(); - for (; actual_dims_size != 0; --actual_dims_size) { - if ((*dims)[actual_dims_size - 1] != 1) - break; - } - if (actual_dims_size != dims->size()) { - auto actual_dims = framework::vectorize(*dims); - actual_dims.resize(actual_dims_size); - *dims = framework::make_ddim(actual_dims); - } + // Remove trailing dimensions of size 1 for y + auto actual_dims_size = dims->size(); + for (; actual_dims_size != 0; --actual_dims_size) { + if ((*dims)[actual_dims_size - 1] != 1) + break; + } + if (actual_dims_size != dims->size()) { + auto actual_dims = framework::vectorize(*dims); + actual_dims.resize(actual_dims_size); + *dims = framework::make_ddim(actual_dims); + } } template class RowwiseTransformIterator { - public: - RowwiseTransformIterator(const T *ptr, int n) : ptr_(ptr), i_(0), n_(n) {} - - RowwiseTransformIterator &operator++() { - ++i_; - if (UNLIKELY(i_ == n_)) { - i_ = 0; - } - return *this; - } +public: + RowwiseTransformIterator(const T *ptr, int n) : ptr_(ptr), i_(0), n_(n) {} - bool operator==(const RowwiseTransformIterator &rhs) const { - return (ptr_ + i_) == &(*rhs); + RowwiseTransformIterator &operator++() { + ++i_; + if (UNLIKELY(i_ == n_)) { + i_ = 0; } + return *this; + } - bool operator!=(const RowwiseTransformIterator &rhs) const { - return (ptr_ + i_) != &(*rhs); - } + bool operator==(const RowwiseTransformIterator &rhs) const { + return (ptr_ + i_) == &(*rhs); + } - const T &operator*() { return ptr_[i_]; } + bool operator!=(const RowwiseTransformIterator &rhs) const { + return (ptr_ + i_) != &(*rhs); + } - private: - const T *ptr_; - int i_; - int64_t n_; + const T &operator*() { return ptr_[i_]; } + +private: + const T *ptr_; + int i_; + int64_t n_; }; /// (4,20,2)+(20,): (20,) just as (20,1), when move 2 strides in last @@ -101,106 +101,105 @@ template class RowwiseTransformIterator { /// in (4,20,2) is 2 , /// (20,1) move 1 stride , to fill(add) 2 element with the same number. template class MidWiseTransformIterator { - public: - MidWiseTransformIterator(const T *ptr, int n, int post) - : ptr_(ptr), i_(0), j_(0), n_(n), post_(post) {} - - MidWiseTransformIterator &operator++() { - ++j_; - if (UNLIKELY(j_ == post_)) { - ++i_; - j_ = 0; - if (UNLIKELY(i_ == n_)) { - i_ = 0; - } - } - return *this; - } - - bool operator==(const MidWiseTransformIterator &rhs) const { - return (ptr_ + i_) == &(*rhs); - } - - bool operator!=(const MidWiseTransformIterator &rhs) const { - return (ptr_ + i_) != &(*rhs); - } - - const T &operator*() { return ptr_[i_]; } - - private: - const T *ptr_; - int64_t i_; - int64_t j_; - int64_t n_; - int64_t post_; +public: + MidWiseTransformIterator(const T *ptr, int n, int post) + : ptr_(ptr), i_(0), j_(0), n_(n), post_(post) {} + + MidWiseTransformIterator &operator++() { + ++j_; + if (UNLIKELY(j_ == post_)) { + ++i_; + j_ = 0; + if (UNLIKELY(i_ == n_)) { + i_ = 0; + } + } + return *this; + } + + bool operator==(const MidWiseTransformIterator &rhs) const { + return (ptr_ + i_) == &(*rhs); + } + + bool operator!=(const MidWiseTransformIterator &rhs) const { + return (ptr_ + i_) != &(*rhs); + } + + const T &operator*() { return ptr_[i_]; } + +private: + const T *ptr_; + int64_t i_; + int64_t j_; + int64_t n_; + int64_t post_; }; template class TransformFunctor { - public: - TransformFunctor(const framework::Tensor *x, const framework::Tensor *y, - framework::Tensor *z, Functor func) - : x_(x->data()), y_(y->data()), z_(z->mutable_data()), - nx_(x->numel()), func_(func) {} - - inline void Run() const { - math::Transform trans; - // 同时执行func(x_, y_)传入z_。 - trans(x_, x_ + nx_, y_, z_, func_); - } - - inline void RunRowWise(int n, int pre) const { - math::Transform trans; - trans(x_, x_ + nx_, RowwiseTransformIterator(y_, n), z_, func_); - } - - inline void RunMidWise(int n, int pre, int post) const { - math::Transform trans; - trans(x_, x_ + nx_, MidWiseTransformIterator(y_, n, post), z_, - func_); - } - - private: - const T *x_; - const T *y_; - OutType *z_; - int64_t nx_; - Functor func_; +public: + TransformFunctor(const framework::Tensor *x, const framework::Tensor *y, + framework::Tensor *z, Functor func) + : x_(x->data()), y_(y->data()), z_(z->mutable_data()), + nx_(x->numel()), func_(func) {} + + inline void Run() const { + math::Transform trans; + // 同时执行func(x_, y_)传入z_。 + trans(x_, x_ + nx_, y_, z_, func_); + } + + inline void RunRowWise(int n, int pre) const { + math::Transform trans; + trans(x_, x_ + nx_, RowwiseTransformIterator(y_, n), z_, func_); + } + + inline void RunMidWise(int n, int pre, int post) const { + math::Transform trans; + trans(x_, x_ + nx_, MidWiseTransformIterator(y_, n, post), z_, func_); + } + +private: + const T *x_; + const T *y_; + OutType *z_; + int64_t nx_; + Functor func_; }; template void ElementwiseComputeEx(const framework::Tensor *x, const framework::Tensor *y, int axis, Functor func, framework::Tensor *z) { - TransformFunctor functor(x, y, z, func); - - auto x_dims = x->dims(); - auto y_dims = y->dims(); - // PADDLE_ENFORCE_GE(x_dims.size(), y_dims.size(), - // "Rank of first input must >= rank of second - // input."); - - if (x_dims == y_dims) { - functor.Run(); - return; - } - - /// axis = -1 represent the last dimension. - axis = (axis == -1 ? x_dims.size() - y_dims.size() : axis); - // PADDLE_ENFORCE(axis >= 0 && axis < x_dims.size(), - // "Axis should be in range [0, x_dims)"); - trim_trailing_singular_dims(&y_dims); - axis = (y_dims.size() == 0) ? x_dims.size() : axis; - - int pre, n, post; - get_mid_dims(x_dims, y_dims, axis, &pre, &n, &post); - if (post == 1) { - functor.RunRowWise(n, pre); - return; - } else { - functor.RunMidWise(n, pre, post); - return; - } + TransformFunctor functor(x, y, z, func); + + auto x_dims = x->dims(); + auto y_dims = y->dims(); + // PADDLE_ENFORCE_GE(x_dims.size(), y_dims.size(), + // "Rank of first input must >= rank of second + // input."); + + if (x_dims == y_dims) { + functor.Run(); + return; + } + + /// axis = -1 represent the last dimension. + axis = (axis == -1 ? x_dims.size() - y_dims.size() : axis); + // PADDLE_ENFORCE(axis >= 0 && axis < x_dims.size(), + // "Axis should be in range [0, x_dims)"); + trim_trailing_singular_dims(&y_dims); + axis = (y_dims.size() == 0) ? x_dims.size() : axis; + + int pre, n, post; + get_mid_dims(x_dims, y_dims, axis, &pre, &n, &post); + if (post == 1) { + functor.RunRowWise(n, pre); + return; + } else { + functor.RunMidWise(n, pre, post); + return; + } } } // namespace operators diff --git a/src/operators/math/im2col.cc b/src/operators/math/im2col.cc index 41e4120a3c9a5af10153c851aed864cae6be3b58..848c5118ebfc34a5a9397f1ebd531f88053255b9 100644 --- a/src/operators/math/im2col.cc +++ b/src/operators/math/im2col.cc @@ -26,70 +26,65 @@ namespace math { * output_width] */ template class Im2ColFunctor { - public: - void operator()(const framework::Tensor &im, - const std::vector &dilation, - const std::vector &stride, - const std::vector &padding, framework::Tensor *col) { - // PADDLE_ENFORCE(im.dims().size() == 3); - // PADDLE_ENFORCE(col->dims().size() == 5); +public: + void operator()(const framework::Tensor &im, const std::vector &dilation, + const std::vector &stride, + const std::vector &padding, framework::Tensor *col) { + // PADDLE_ENFORCE(im.dims().size() == 3); + // PADDLE_ENFORCE(col->dims().size() == 5); - int im_channels = im.dims()[0]; - int im_height = im.dims()[1]; - int im_width = im.dims()[2]; - int filter_height = col->dims()[1]; - int filter_width = col->dims()[2]; - int col_height = col->dims()[3]; - int col_width = col->dims()[4]; + int im_channels = im.dims()[0]; + int im_height = im.dims()[1]; + int im_width = im.dims()[2]; + int filter_height = col->dims()[1]; + int filter_width = col->dims()[2]; + int col_height = col->dims()[3]; + int col_width = col->dims()[4]; - // PADDLE_ENFORCE_EQ((im_height + padding[0] + padding[2] - // - - // ((dilation[0] * (filter_height - 1) - // + 1))) / - // stride[0] + - // 1, - // col_height, - // "Output_height and - // padding(padding_up, padding_down) - // are " "inconsistent."); - // PADDLE_ENFORCE_EQ((im_width + padding[1] + padding[3] - // - - // ((dilation[1] * (filter_width - 1) - // + 1))) / - // stride[1] + - // 1, - // col_width, - // "Output_height and - // padding(padding_up, padding_down) - // are " "inconsistent."); + // PADDLE_ENFORCE_EQ((im_height + padding[0] + padding[2] + // - + // ((dilation[0] * (filter_height - 1) + // + 1))) / + // stride[0] + + // 1, + // col_height, + // "Output_height and + // padding(padding_up, padding_down) + // are " "inconsistent."); + // PADDLE_ENFORCE_EQ((im_width + padding[1] + padding[3] + // - + // ((dilation[1] * (filter_width - 1) + // + 1))) / + // stride[1] + + // 1, + // col_width, + // "Output_height and + // padding(padding_up, padding_down) + // are " "inconsistent."); - int channels_col = im_channels * filter_height * filter_width; + int channels_col = im_channels * filter_height * filter_width; - const T *im_data = im.data(); - T *col_data = col->data(); - for (int c = 0; c < channels_col; ++c) { - int w_offset = c % filter_width; - int h_offset = (c / filter_width) % filter_height; - int c_im = c / (filter_width * filter_height); - for (int h = 0; h < col_height; ++h) { - int im_row_idx = - h * stride[0] - padding[0] + h_offset * dilation[0]; - for (int w = 0; w < col_width; ++w) { - int im_col_idx = - w * stride[1] - padding[1] + w_offset * dilation[1]; - int col_idx = (c * col_height + h) * col_width + w; - int im_idx = - (im_row_idx + c_im * im_height) * im_width + im_col_idx; + const T *im_data = im.data(); + T *col_data = col->data(); + for (int c = 0; c < channels_col; ++c) { + int w_offset = c % filter_width; + int h_offset = (c / filter_width) % filter_height; + int c_im = c / (filter_width * filter_height); + for (int h = 0; h < col_height; ++h) { + int im_row_idx = h * stride[0] - padding[0] + h_offset * dilation[0]; + for (int w = 0; w < col_width; ++w) { + int im_col_idx = w * stride[1] - padding[1] + w_offset * dilation[1]; + int col_idx = (c * col_height + h) * col_width + w; + int im_idx = (im_row_idx + c_im * im_height) * im_width + im_col_idx; - col_data[col_idx] = - (im_row_idx < 0 || im_row_idx >= im_height || - im_col_idx < 0 || im_col_idx >= im_width) - ? static_cast(0) - : im_data[im_idx]; - } - } + col_data[col_idx] = (im_row_idx < 0 || im_row_idx >= im_height || + im_col_idx < 0 || im_col_idx >= im_width) + ? static_cast(0) + : im_data[im_idx]; } + } } + } }; /* @@ -99,67 +94,64 @@ template class Im2ColFunctor { * output_width] */ template class Col2ImFunctor { - public: - void operator()(const framework::Tensor &col, - const std::vector &dilation, - const std::vector &stride, - const std::vector &padding, framework::Tensor *im) { - // PADDLE_ENFORCE(im->dims().size() == 3); - // PADDLE_ENFORCE(col.dims().size() == 5); - int im_channels = im->dims()[0]; - int im_height = im->dims()[1]; - int im_width = im->dims()[2]; - int filter_height = col.dims()[1]; - int filter_width = col.dims()[2]; - int col_height = col.dims()[3]; - int col_width = col.dims()[4]; +public: + void operator()(const framework::Tensor &col, + const std::vector &dilation, + const std::vector &stride, + const std::vector &padding, framework::Tensor *im) { + // PADDLE_ENFORCE(im->dims().size() == 3); + // PADDLE_ENFORCE(col.dims().size() == 5); + int im_channels = im->dims()[0]; + int im_height = im->dims()[1]; + int im_width = im->dims()[2]; + int filter_height = col.dims()[1]; + int filter_width = col.dims()[2]; + int col_height = col.dims()[3]; + int col_width = col.dims()[4]; - // PADDLE_ENFORCE_EQ((im_height + padding[0] + padding[2] - // - - // ((dilation[0] * (filter_height - 1) - // + 1))) / - // stride[0] + - // 1, - // col_height, - // "Output_height and - // padding(padding_up, padding_down) - // are " "inconsistent."); - // PADDLE_ENFORCE_EQ((im_width + padding[1] + padding[3] - // - - // ((dilation[1] * (filter_width - 1) - // + 1))) / - // stride[1] + - // 1, - // col_width, - // "Output_height and - // padding(padding_up, padding_down) - // are " "inconsistent."); + // PADDLE_ENFORCE_EQ((im_height + padding[0] + padding[2] + // - + // ((dilation[0] * (filter_height - 1) + // + 1))) / + // stride[0] + + // 1, + // col_height, + // "Output_height and + // padding(padding_up, padding_down) + // are " "inconsistent."); + // PADDLE_ENFORCE_EQ((im_width + padding[1] + padding[3] + // - + // ((dilation[1] * (filter_width - 1) + // + 1))) / + // stride[1] + + // 1, + // col_width, + // "Output_height and + // padding(padding_up, padding_down) + // are " "inconsistent."); - int channels_col = im_channels * filter_height * filter_width; + int channels_col = im_channels * filter_height * filter_width; - T *im_data = im->data(); - const T *col_data = col.data(); + T *im_data = im->data(); + const T *col_data = col.data(); - for (int c = 0; c < channels_col; ++c) { - int w_offset = c % filter_width; - int h_offset = (c / filter_width) % filter_height; - int c_im = c / (filter_width * filter_height); - for (int h = 0; h < col_height; ++h) { - int im_row_idx = - h * stride[0] - padding[0] + h_offset * dilation[0]; - for (int w = 0; w < col_width; ++w) { - int im_col_idx = - w * stride[1] - padding[1] + w_offset * dilation[1]; - if ((im_row_idx) >= 0 && (im_row_idx) < im_height && - (im_col_idx) >= 0 && (im_col_idx) < im_width) { - im_data[(im_row_idx + c_im * im_height) * im_width + - im_col_idx] += - col_data[(c * col_height + h) * col_width + w]; - } - } - } + for (int c = 0; c < channels_col; ++c) { + int w_offset = c % filter_width; + int h_offset = (c / filter_width) % filter_height; + int c_im = c / (filter_width * filter_height); + for (int h = 0; h < col_height; ++h) { + int im_row_idx = h * stride[0] - padding[0] + h_offset * dilation[0]; + for (int w = 0; w < col_width; ++w) { + int im_col_idx = w * stride[1] - padding[1] + w_offset * dilation[1]; + if ((im_row_idx) >= 0 && (im_row_idx) < im_height && + (im_col_idx) >= 0 && (im_col_idx) < im_width) { + im_data[(im_row_idx + c_im * im_height) * im_width + im_col_idx] += + col_data[(c * col_height + h) * col_width + w]; + } } + } } + } }; template class Im2ColFunctor; @@ -174,74 +166,69 @@ template class Col2ImFunctor; * filter_width] */ template class Im2ColFunctor { - public: - void operator()(const framework::Tensor &im, - const std::vector &dilation, - const std::vector &stride, - const std::vector &padding, framework::Tensor *col) { - // PADDLE_ENFORCE(im.dims().size() == 3); - // PADDLE_ENFORCE(col->dims().size() == 5); - int im_channels = im.dims()[0]; - int im_height = im.dims()[1]; - int im_width = im.dims()[2]; - int filter_height = col->dims()[3]; - int filter_width = col->dims()[4]; - int col_height = col->dims()[0]; - int col_width = col->dims()[1]; +public: + void operator()(const framework::Tensor &im, const std::vector &dilation, + const std::vector &stride, + const std::vector &padding, framework::Tensor *col) { + // PADDLE_ENFORCE(im.dims().size() == 3); + // PADDLE_ENFORCE(col->dims().size() == 5); + int im_channels = im.dims()[0]; + int im_height = im.dims()[1]; + int im_width = im.dims()[2]; + int filter_height = col->dims()[3]; + int filter_width = col->dims()[4]; + int col_height = col->dims()[0]; + int col_width = col->dims()[1]; - // PADDLE_ENFORCE_EQ( - // (im_height + padding[0] + padding[2] - - // filter_height) / stride[0] - // + 1, col_height, "Output_height and - // padding(padding_up, - // padding_down) are " "inconsistent."); - // PADDLE_ENFORCE_EQ( - // (im_width + padding[1] + padding[3] - - // filter_width) / stride[1] + - // 1, col_width, "col_width and padding(padding_left, - // padding_right) - // are " "inconsistent."); + // PADDLE_ENFORCE_EQ( + // (im_height + padding[0] + padding[2] - + // filter_height) / stride[0] + // + 1, col_height, "Output_height and + // padding(padding_up, + // padding_down) are " "inconsistent."); + // PADDLE_ENFORCE_EQ( + // (im_width + padding[1] + padding[3] - + // filter_width) / stride[1] + + // 1, col_width, "col_width and padding(padding_left, + // padding_right) + // are " "inconsistent."); - const T *im_data = im.data(); - T *col_data = col->data(); + const T *im_data = im.data(); + T *col_data = col->data(); - for (int col_row_idx = 0; col_row_idx < col_height; ++col_row_idx) { - for (int col_col_idx = 0; col_col_idx < col_width; ++col_col_idx) { - for (int channel = 0; channel < im_channels; ++channel) { - for (int filter_row_idx = 0; filter_row_idx < filter_height; - ++filter_row_idx) { - int im_row_offset = col_row_idx * stride[0] + - filter_row_idx - padding[0]; - for (int filter_col_idx = 0; - filter_col_idx < filter_width; ++filter_col_idx) { - int im_col_offset = col_col_idx * stride[1] + - filter_col_idx - padding[1]; + for (int col_row_idx = 0; col_row_idx < col_height; ++col_row_idx) { + for (int col_col_idx = 0; col_col_idx < col_width; ++col_col_idx) { + for (int channel = 0; channel < im_channels; ++channel) { + for (int filter_row_idx = 0; filter_row_idx < filter_height; + ++filter_row_idx) { + int im_row_offset = + col_row_idx * stride[0] + filter_row_idx - padding[0]; + for (int filter_col_idx = 0; filter_col_idx < filter_width; + ++filter_col_idx) { + int im_col_offset = + col_col_idx * stride[1] + filter_col_idx - padding[1]; - int col_offset = - ((((col_row_idx)*col_width + col_col_idx) * - im_channels + - channel) * - filter_height + - filter_row_idx) * - filter_width + - filter_col_idx; + int col_offset = + ((((col_row_idx)*col_width + col_col_idx) * im_channels + + channel) * + filter_height + + filter_row_idx) * + filter_width + + filter_col_idx; - int im_offset = - (channel * im_height + im_row_offset) * - im_width + - im_col_offset; - col_data[col_offset] = - (im_row_offset < 0 || - im_row_offset >= im_height || - im_col_offset < 0 || im_col_offset >= im_width) - ? static_cast(0) - : im_data[im_offset]; - } - } - } + int im_offset = (channel * im_height + im_row_offset) * im_width + + im_col_offset; + col_data[col_offset] = + (im_row_offset < 0 || im_row_offset >= im_height || + im_col_offset < 0 || im_col_offset >= im_width) + ? static_cast(0) + : im_data[im_offset]; } + } } + } } + } }; /* @@ -251,74 +238,70 @@ template class Im2ColFunctor { * filter_width] */ template class Col2ImFunctor { - public: - void operator()(const framework::Tensor &col, - const std::vector &dilation, - const std::vector &stride, - const std::vector &padding, framework::Tensor *im) { - // PADDLE_ENFORCE(im->dims().size() == 3); - // PADDLE_ENFORCE(col.dims().size() == 5); - int im_channels = im->dims()[0]; - int im_height = im->dims()[1]; - int im_width = im->dims()[2]; - int filter_height = col.dims()[3]; - int filter_width = col.dims()[4]; - int col_height = col.dims()[0]; - int col_width = col.dims()[1]; +public: + void operator()(const framework::Tensor &col, + const std::vector &dilation, + const std::vector &stride, + const std::vector &padding, framework::Tensor *im) { + // PADDLE_ENFORCE(im->dims().size() == 3); + // PADDLE_ENFORCE(col.dims().size() == 5); + int im_channels = im->dims()[0]; + int im_height = im->dims()[1]; + int im_width = im->dims()[2]; + int filter_height = col.dims()[3]; + int filter_width = col.dims()[4]; + int col_height = col.dims()[0]; + int col_width = col.dims()[1]; - // PADDLE_ENFORCE_EQ( - // (im_height + padding[0] + padding[2] - - // filter_height) / stride[0] - // + 1, col_height, "Output_height and - // padding(padding_up, - // padding_down) are " "inconsistent."); - // PADDLE_ENFORCE_EQ( - // (im_width + padding[1] + padding[3] - - // filter_width) / stride[1] + - // 1, col_width, "col_width and padding(padding_left, - // padding_right) - // are " "inconsistent."); + // PADDLE_ENFORCE_EQ( + // (im_height + padding[0] + padding[2] - + // filter_height) / stride[0] + // + 1, col_height, "Output_height and + // padding(padding_up, + // padding_down) are " "inconsistent."); + // PADDLE_ENFORCE_EQ( + // (im_width + padding[1] + padding[3] - + // filter_width) / stride[1] + + // 1, col_width, "col_width and padding(padding_left, + // padding_right) + // are " "inconsistent."); - T *im_data = im->data(); - const T *col_data = col.data(); + T *im_data = im->data(); + const T *col_data = col.data(); - for (int col_row_idx = 0; col_row_idx < col_height; ++col_row_idx) { - for (int col_col_idx = 0; col_col_idx < col_width; ++col_col_idx) { - for (int channel = 0; channel < im_channels; ++channel) { - for (int filter_row_idx = 0; filter_row_idx < filter_height; - ++filter_row_idx) { - int im_row_offset = col_row_idx * stride[0] + - filter_row_idx - padding[0]; - for (int filter_col_idx = 0; - filter_col_idx < filter_width; ++filter_col_idx) { - int im_col_offset = col_col_idx * stride[1] + - filter_col_idx - padding[1]; + for (int col_row_idx = 0; col_row_idx < col_height; ++col_row_idx) { + for (int col_col_idx = 0; col_col_idx < col_width; ++col_col_idx) { + for (int channel = 0; channel < im_channels; ++channel) { + for (int filter_row_idx = 0; filter_row_idx < filter_height; + ++filter_row_idx) { + int im_row_offset = + col_row_idx * stride[0] + filter_row_idx - padding[0]; + for (int filter_col_idx = 0; filter_col_idx < filter_width; + ++filter_col_idx) { + int im_col_offset = + col_col_idx * stride[1] + filter_col_idx - padding[1]; - int col_offset = - (((col_row_idx * col_width + col_col_idx) * - im_channels + - channel) * - filter_height + - filter_row_idx) * - filter_width + - filter_col_idx; + int col_offset = + (((col_row_idx * col_width + col_col_idx) * im_channels + + channel) * + filter_height + + filter_row_idx) * + filter_width + + filter_col_idx; - if (im_row_offset >= 0 && - im_row_offset < im_height && - im_col_offset >= 0 && - im_col_offset < im_width) { - int im_offset = - (channel * im_height + im_row_offset) * - im_width + - im_col_offset; - im_data[im_offset] += col_data[col_offset]; - } - } - } - } + if (im_row_offset >= 0 && im_row_offset < im_height && + im_col_offset >= 0 && im_col_offset < im_width) { + int im_offset = + (channel * im_height + im_row_offset) * im_width + + im_col_offset; + im_data[im_offset] += col_data[col_offset]; + } } + } } + } } + } }; template class Im2ColFunctor; diff --git a/src/operators/math/im2col.h b/src/operators/math/im2col.h index 12c58925cda6d1209c00e6e068d6d3941103f198..22667950eda09a67c9ca0c71dccf8c9fe20c89c0 100644 --- a/src/operators/math/im2col.h +++ b/src/operators/math/im2col.h @@ -89,20 +89,19 @@ enum class ColFormat { kCFO = 0, kOCF = 1 }; */ template class Im2ColFunctor { - public: - void operator()(const framework::Tensor &im, - const std::vector &dilation, - const std::vector &stride, - const std::vector &padding, framework::Tensor *col); +public: + void operator()(const framework::Tensor &im, const std::vector &dilation, + const std::vector &stride, + const std::vector &padding, framework::Tensor *col); }; template class Col2ImFunctor { - public: - void operator()(const framework::Tensor &col, - const std::vector &dilation, - const std::vector &stride, - const std::vector &padding, framework::Tensor *im); +public: + void operator()(const framework::Tensor &col, + const std::vector &dilation, + const std::vector &stride, + const std::vector &padding, framework::Tensor *im); }; } // namespace math diff --git a/src/operators/math/math_function.cc b/src/operators/math/math_function.cc index 4036d51b1f59f8d201d61e4d151fdf87b9dc5840..30038ce0ba7be699a4ab7d2351bdc43c1979c0da 100644 --- a/src/operators/math/math_function.cc +++ b/src/operators/math/math_function.cc @@ -22,11 +22,11 @@ template <> void gemm(const CBLAS_TRANSPOSE transA, const CBLAS_TRANSPOSE transB, const int M, const int N, const int K, const float alpha, const float *A, const float *B, const float beta, float *C) { - int lda = (transA == CblasNoTrans) ? K : M; - int ldb = (transB == CblasNoTrans) ? N : K; - int ldc = N; - cblas_sgemm(CblasRowMajor, transA, transB, M, N, K, alpha, A, lda, B, ldb, - beta, C, ldc); + int lda = (transA == CblasNoTrans) ? K : M; + int ldb = (transB == CblasNoTrans) ? N : K; + int ldc = N; + cblas_sgemm(CblasRowMajor, transA, transB, M, N, K, alpha, A, lda, B, ldb, + beta, C, ldc); } template <> @@ -34,11 +34,11 @@ void gemm(const CBLAS_TRANSPOSE transA, const CBLAS_TRANSPOSE transB, const int M, const int N, const int K, const double alpha, const double *A, const double *B, const double beta, double *C) { - int lda = (transA == CblasNoTrans) ? K : M; - int ldb = (transB == CblasNoTrans) ? N : K; - int ldc = N; - cblas_dgemm(CblasRowMajor, transA, transB, M, N, K, alpha, A, lda, B, ldb, - beta, C, ldc); + int lda = (transA == CblasNoTrans) ? K : M; + int ldb = (transB == CblasNoTrans) ? N : K; + int ldc = N; + cblas_dgemm(CblasRowMajor, transA, transB, M, N, K, alpha, A, lda, B, ldb, + beta, C, ldc); } template <> @@ -46,9 +46,9 @@ void gemm(const bool transA, const bool transB, const int M, const int N, const int K, const float alpha, const float *A, const int lda, const float *B, const int ldb, const float beta, float *C, const int ldc) { - cblas_sgemm(CblasRowMajor, transA == false ? CblasNoTrans : CblasTrans, - transB == false ? CblasNoTrans : CblasTrans, M, N, K, alpha, A, - lda, B, ldb, beta, C, ldc); + cblas_sgemm(CblasRowMajor, transA == false ? CblasNoTrans : CblasTrans, + transB == false ? CblasNoTrans : CblasTrans, M, N, K, alpha, A, + lda, B, ldb, beta, C, ldc); } template <> @@ -56,67 +56,67 @@ void gemm(const bool transA, const bool transB, const int M, const int N, const int K, const double alpha, const double *A, const int lda, const double *B, const int ldb, const double beta, double *C, const int ldc) { - cblas_dgemm(CblasRowMajor, transA == false ? CblasNoTrans : CblasTrans, - transB == false ? CblasNoTrans : CblasTrans, M, N, K, alpha, A, - lda, B, ldb, beta, C, ldc); + cblas_dgemm(CblasRowMajor, transA == false ? CblasNoTrans : CblasTrans, + transB == false ? CblasNoTrans : CblasTrans, M, N, K, alpha, A, + lda, B, ldb, beta, C, ldc); } template <> void matmul(const framework::Tensor &matrix_a, bool trans_a, const framework::Tensor &matrix_b, bool trans_b, float alpha, framework::Tensor *matrix_out, float beta) { - auto dim_a = matrix_a.dims(); - auto dim_b = matrix_b.dims(); - auto dim_out = matrix_out->dims(); - // PADDLE_ENFORCE(dim_a.size() == 2 && dim_b.size() == 2 && - // dim_out.size() == - // 2, - // "The input and output of matmul be matrix"); - // - // PADDLE_ENFORCE(platform::is_cpu_place(matrix_a.place()) && - // platform::is_cpu_place(matrix_b.place()) - // && - // platform::is_cpu_place(matrix_out->place()), - // "Matrix must all be in CPUPlace"); - - int M = dim_out[0]; - int N = dim_out[1]; - int K = (trans_a == false) ? dim_a[1] : dim_a[0]; - - CBLAS_TRANSPOSE transA = (trans_a == false) ? CblasNoTrans : CblasTrans; - CBLAS_TRANSPOSE transB = (trans_b == false) ? CblasNoTrans : CblasTrans; - - gemm(transA, transB, M, N, K, alpha, matrix_a.data(), - matrix_b.data(), beta, matrix_out->data()); + auto dim_a = matrix_a.dims(); + auto dim_b = matrix_b.dims(); + auto dim_out = matrix_out->dims(); + // PADDLE_ENFORCE(dim_a.size() == 2 && dim_b.size() == 2 && + // dim_out.size() == + // 2, + // "The input and output of matmul be matrix"); + // + // PADDLE_ENFORCE(platform::is_cpu_place(matrix_a.place()) && + // platform::is_cpu_place(matrix_b.place()) + // && + // platform::is_cpu_place(matrix_out->place()), + // "Matrix must all be in CPUPlace"); + + int M = dim_out[0]; + int N = dim_out[1]; + int K = (trans_a == false) ? dim_a[1] : dim_a[0]; + + CBLAS_TRANSPOSE transA = (trans_a == false) ? CblasNoTrans : CblasTrans; + CBLAS_TRANSPOSE transB = (trans_b == false) ? CblasNoTrans : CblasTrans; + + gemm(transA, transB, M, N, K, alpha, matrix_a.data(), + matrix_b.data(), beta, matrix_out->data()); } template <> void matmul(const framework::Tensor &matrix_a, bool trans_a, const framework::Tensor &matrix_b, bool trans_b, double alpha, framework::Tensor *matrix_out, double beta) { - auto dim_a = matrix_a.dims(); - auto dim_b = matrix_b.dims(); - auto dim_out = matrix_out->dims(); - // PADDLE_ENFORCE(dim_a.size() == 2 && dim_b.size() == 2 && - // dim_out.size() == - // 2, - // "The input and output of matmul be matrix"); - // - // PADDLE_ENFORCE(platform::is_cpu_place(matrix_a.place()) && - // platform::is_cpu_place(matrix_b.place()) - // && - // platform::is_cpu_place(matrix_out->place()), - // "Matrix must all be in CPUPlace"); - - int M = dim_out[0]; - int N = dim_out[1]; - int K = (trans_a == false) ? dim_a[1] : dim_a[0]; - - CBLAS_TRANSPOSE transA = (trans_a == false) ? CblasNoTrans : CblasTrans; - CBLAS_TRANSPOSE transB = (trans_b == false) ? CblasNoTrans : CblasTrans; - - gemm(transA, transB, M, N, K, alpha, matrix_a.data(), - matrix_b.data(), beta, matrix_out->data()); + auto dim_a = matrix_a.dims(); + auto dim_b = matrix_b.dims(); + auto dim_out = matrix_out->dims(); + // PADDLE_ENFORCE(dim_a.size() == 2 && dim_b.size() == 2 && + // dim_out.size() == + // 2, + // "The input and output of matmul be matrix"); + // + // PADDLE_ENFORCE(platform::is_cpu_place(matrix_a.place()) && + // platform::is_cpu_place(matrix_b.place()) + // && + // platform::is_cpu_place(matrix_out->place()), + // "Matrix must all be in CPUPlace"); + + int M = dim_out[0]; + int N = dim_out[1]; + int K = (trans_a == false) ? dim_a[1] : dim_a[0]; + + CBLAS_TRANSPOSE transA = (trans_a == false) ? CblasNoTrans : CblasTrans; + CBLAS_TRANSPOSE transB = (trans_b == false) ? CblasNoTrans : CblasTrans; + + gemm(transA, transB, M, N, K, alpha, matrix_a.data(), + matrix_b.data(), beta, matrix_out->data()); } } // namespace math diff --git a/src/operators/math/pool3x3.h b/src/operators/math/pool3x3.h index 8ee50a980e91f75678823dbb28bffd1c8ffb55e1..3d4cc7975a12e03646a91184250dd53ce5faeb69 100644 --- a/src/operators/math/pool3x3.h +++ b/src/operators/math/pool3x3.h @@ -22,9 +22,9 @@ SOFTWARE. #endif // __ARM_NEON static void Pool3x3Max() { - // todo impl with neon + // todo impl with neon } static void Pool3x3Avg() { - // todo impl with neon + // todo impl with neon } diff --git a/src/operators/math/pool_2x2.h b/src/operators/math/pool_2x2.h index c9a9486ae8c19341f3fbd99b0440f1f301f6762d..b1ab4fadbba173eda12d5e8fb23713094f220129 100644 --- a/src/operators/math/pool_2x2.h +++ b/src/operators/math/pool_2x2.h @@ -22,9 +22,9 @@ SOFTWARE. #endif // __ARM_NEON static void Pool2x2Max() { - // todo impl with neon + // todo impl with neon } static void Pool2x2Avg() { - // todo impl with neon + // todo impl with neon } diff --git a/src/operators/math/pooling.cpp b/src/operators/math/pooling.cpp index 5cfbe73dae6d41636704dc97d904786dfb2921ba..58b230b525748271223ded2ad89bc5cfa883bf84 100644 --- a/src/operators/math/pooling.cpp +++ b/src/operators/math/pooling.cpp @@ -30,67 +30,65 @@ namespace math { */ template class PoolFunctor { - public: - void operator()(const framework::Tensor &input, - const std::vector &ksize, - const std::vector &strides, - const std::vector &paddings, PoolProcess pool_process, - framework::Tensor *output) { +public: + void operator()(const framework::Tensor &input, const std::vector &ksize, + const std::vector &strides, + const std::vector &paddings, PoolProcess pool_process, + framework::Tensor *output) { - const int batch_size = input.dims()[0]; + const int batch_size = input.dims()[0]; - const int input_height = input.dims()[2]; + const int input_height = input.dims()[2]; - const int input_width = input.dims()[3]; - if (output == nullptr) { - DLOG << "output tensor is null"; - } - const int output_channels = output->dims()[1]; + const int input_width = input.dims()[3]; + if (output == nullptr) { + DLOG << "output tensor is null"; + } + const int output_channels = output->dims()[1]; - const int output_height = output->dims()[2]; - const int output_width = output->dims()[3]; - const int ksize_height = ksize[0]; - const int ksize_width = ksize[1]; - const int stride_height = strides[0]; - const int stride_width = strides[1]; - const int padding_height = paddings[0]; - const int padding_width = paddings[1]; + const int output_height = output->dims()[2]; + const int output_width = output->dims()[3]; + const int ksize_height = ksize[0]; + const int ksize_width = ksize[1]; + const int stride_height = strides[0]; + const int stride_width = strides[1]; + const int padding_height = paddings[0]; + const int padding_width = paddings[1]; - const int input_stride = input_height * input_width; - const int output_stride = output_height * output_width; + const int input_stride = input_height * input_width; + const int output_stride = output_height * output_width; - const T *input_data = input.data(); - T *output_data = output->mutable_data(); + const T *input_data = input.data(); + T *output_data = output->mutable_data(); - for (int i = 0; i < batch_size; i++) { + for (int i = 0; i < batch_size; i++) { #pragma omp parallel for - for (int c = 0; c < output_channels; ++c) { - for (int ph = 0; ph < output_height; ++ph) { - int hstart = ph * stride_height - padding_height; - int hend = std::min(hstart + ksize_height, input_height); - hstart = std::max(hstart, 0); - for (int pw = 0; pw < output_width; ++pw) { - int wstart = pw * stride_width - padding_width; - int wend = std::min(wstart + ksize_width, input_width); - wstart = std::max(wstart, 0); + for (int c = 0; c < output_channels; ++c) { + for (int ph = 0; ph < output_height; ++ph) { + int hstart = ph * stride_height - padding_height; + int hend = std::min(hstart + ksize_height, input_height); + hstart = std::max(hstart, 0); + for (int pw = 0; pw < output_width; ++pw) { + int wstart = pw * stride_width - padding_width; + int wend = std::min(wstart + ksize_width, input_width); + wstart = std::max(wstart, 0); - T ele = pool_process.initial(); - for (int h = hstart; h < hend; ++h) { - for (int w = wstart; w < wend; ++w) { - pool_process.compute( - input_data[h * input_width + w], &ele); - } - } - int pool_size = (hend - hstart) * (wend - wstart); - pool_process.finalize(static_cast(pool_size), &ele); - output_data[ph * output_width + pw] = ele; - } - } - input_data += input_stride; - output_data += output_stride; + T ele = pool_process.initial(); + for (int h = hstart; h < hend; ++h) { + for (int w = wstart; w < wend; ++w) { + pool_process.compute(input_data[h * input_width + w], &ele); + } } + int pool_size = (hend - hstart) * (wend - wstart); + pool_process.finalize(static_cast(pool_size), &ele); + output_data[ph * output_width + pw] = ele; + } } + input_data += input_stride; + output_data += output_stride; + } } + } }; template class PoolFunctor, float>; diff --git a/src/operators/math/pooling.h b/src/operators/math/pooling.h index a8ac2b284593c108fe8fb47099f38cb1926af87b..08ff7c07c6f54c14c1f3390625d25f8d6ae6a5c6 100644 --- a/src/operators/math/pooling.h +++ b/src/operators/math/pooling.h @@ -38,31 +38,30 @@ namespace math { * MaxPoolGrad and AvgPoolGrad are gradient operations respectively. */ template class MaxPool { - public: - inline T initial() { return static_cast(-FLT_MAX); } +public: + inline T initial() { return static_cast(-FLT_MAX); } - inline void compute(const T &x, T *y) { *y = *y > x ? *y : x; } + inline void compute(const T &x, T *y) { *y = *y > x ? *y : x; } - inline void finalize(const T &pool_field, T *y) {} + inline void finalize(const T &pool_field, T *y) {} }; template class AvgPool { - public: - inline T initial() { return static_cast(0); } +public: + inline T initial() { return static_cast(0); } - inline void compute(const T &x, T *y) { *y += x; } + inline void compute(const T &x, T *y) { *y += x; } - inline void finalize(const T &pool_field, T *y) { *y /= pool_field; } + inline void finalize(const T &pool_field, T *y) { *y /= pool_field; } }; template class PoolFunctor { - public: - void operator()(const framework::Tensor &input, - const std::vector &ksize, - const std::vector &strides, - const std::vector &paddings, PoolProcess pool_compute, - framework::Tensor *output); +public: + void operator()(const framework::Tensor &input, const std::vector &ksize, + const std::vector &strides, + const std::vector &paddings, PoolProcess pool_compute, + framework::Tensor *output); }; } } // namespace operators diff --git a/src/operators/math/transform.h b/src/operators/math/transform.h index 6e014a24ba6f9f6e8166ab16c01c3ef79488d40e..85691e376c70475ee369a1aef434bebcfa29467e 100644 --- a/src/operators/math/transform.h +++ b/src/operators/math/transform.h @@ -37,18 +37,18 @@ namespace math { // class, paddle::fluid::operators::RowwiseTRansformIterator. struct Transform { - template - void operator()(InputIter first, InputIter last, OutputIter result, - UnaryOperation op) { - std::transform(first, last, result, op); - } - - template - void operator()(InputIter1 first1, InputIter1 last1, InputIter2 first2, - OutputIter result, BinaryOperation op) { - std::transform(first1, last1, first2, result, op); - } + template + void operator()(InputIter first, InputIter last, OutputIter result, + UnaryOperation op) { + std::transform(first, last, result, op); + } + + template + void operator()(InputIter1 first1, InputIter1 last1, InputIter2 first2, + OutputIter result, BinaryOperation op) { + std::transform(first1, last1, first2, result, op); + } }; } // namespace math } // namespace operators diff --git a/src/operators/math/vol2col.cc b/src/operators/math/vol2col.cc index 89f4dd2e57159c51ff5641fae353f97877090bef..c2ceabe020fb9029e50400fddc70715a6f45b44d 100644 --- a/src/operators/math/vol2col.cc +++ b/src/operators/math/vol2col.cc @@ -26,90 +26,83 @@ using Tensor = paddle_mobile::framework::Tensor; * output_depth, output_height, output_width] */ template class Vol2ColFunctor { - public: - void operator()(const Tensor &vol, const std::vector &dilations, - const std::vector &strides, - const std::vector &paddings, Tensor *col) const { - // PADDLE_ENFORCE(vol.dims().size() == 4); - // PADDLE_ENFORCE(col->dims().size() == 7); - - int input_channels = vol.dims()[0]; - int input_depth = vol.dims()[1]; - int input_height = vol.dims()[2]; - int input_width = vol.dims()[3]; - int filter_depth = col->dims()[1]; - int filter_height = col->dims()[2]; - int filter_width = col->dims()[3]; - int output_depth = col->dims()[4]; - int output_height = col->dims()[5]; - int output_width = col->dims()[6]; - int channels_col = - input_channels * filter_depth * filter_height * filter_width; - - // PADDLE_ENFORCE_EQ((input_depth + 2 * paddings[0] - - // ((dilations[0] * (filter_depth - 1) - // + 1))) / - // strides[0] + - // 1, - // output_depth, - // "input_depth and output_depth are " - // "mismatching."); - // PADDLE_ENFORCE_EQ((input_height + 2 * paddings[1] - - // ((dilations[1] * (filter_height - - // 1) + 1))) / - // strides[1] + - // 1, - // output_height, - // "input_height and output_height are - // " - // "mismatching."); - // PADDLE_ENFORCE_EQ((input_width + 2 * paddings[2] - - // ((dilations[2] * (filter_width - 1) - // + 1))) / - // strides[2] + - // 1, - // output_width, - // "input_width and output_width are " - // "mismatching."); - - const T *vol_data = vol.data(); - T *col_data = col->data(); - - for (int c = 0; c < channels_col; ++c) { - int w_offset = c % filter_width; - int h_offset = (c / filter_width) % filter_height; - int d_offset = (c / filter_width / filter_height) % filter_depth; - int c_in = c / filter_width / filter_height / filter_depth; - for (int d = 0; d < output_depth; ++d) { - int d_pad = - d * strides[0] - paddings[0] + d_offset * dilations[0]; - for (int h = 0; h < output_height; ++h) { - int h_pad = - h * strides[1] - paddings[1] + h_offset * dilations[1]; - for (int w = 0; w < output_width; ++w) { - int w_pad = w * strides[2] - paddings[2] + - w_offset * dilations[2]; - - int col_idx = - ((c * output_depth + d) * output_height + h) * - output_width + - w; - int vol_idx = - ((c_in * input_depth + d_pad) * input_height + - h_pad) * - input_width + - w_pad; - col_data[col_idx] = - (h_pad < 0 || h_pad >= input_height || w_pad < 0 || - w_pad >= input_width || d_pad < 0 || - d_pad >= input_depth) - ? static_cast(0) - : vol_data[vol_idx]; - } - } - } +public: + void operator()(const Tensor &vol, const std::vector &dilations, + const std::vector &strides, + const std::vector &paddings, Tensor *col) const { + // PADDLE_ENFORCE(vol.dims().size() == 4); + // PADDLE_ENFORCE(col->dims().size() == 7); + + int input_channels = vol.dims()[0]; + int input_depth = vol.dims()[1]; + int input_height = vol.dims()[2]; + int input_width = vol.dims()[3]; + int filter_depth = col->dims()[1]; + int filter_height = col->dims()[2]; + int filter_width = col->dims()[3]; + int output_depth = col->dims()[4]; + int output_height = col->dims()[5]; + int output_width = col->dims()[6]; + int channels_col = + input_channels * filter_depth * filter_height * filter_width; + + // PADDLE_ENFORCE_EQ((input_depth + 2 * paddings[0] - + // ((dilations[0] * (filter_depth - 1) + // + 1))) / + // strides[0] + + // 1, + // output_depth, + // "input_depth and output_depth are " + // "mismatching."); + // PADDLE_ENFORCE_EQ((input_height + 2 * paddings[1] - + // ((dilations[1] * (filter_height - + // 1) + 1))) / + // strides[1] + + // 1, + // output_height, + // "input_height and output_height are + // " + // "mismatching."); + // PADDLE_ENFORCE_EQ((input_width + 2 * paddings[2] - + // ((dilations[2] * (filter_width - 1) + // + 1))) / + // strides[2] + + // 1, + // output_width, + // "input_width and output_width are " + // "mismatching."); + + const T *vol_data = vol.data(); + T *col_data = col->data(); + + for (int c = 0; c < channels_col; ++c) { + int w_offset = c % filter_width; + int h_offset = (c / filter_width) % filter_height; + int d_offset = (c / filter_width / filter_height) % filter_depth; + int c_in = c / filter_width / filter_height / filter_depth; + for (int d = 0; d < output_depth; ++d) { + int d_pad = d * strides[0] - paddings[0] + d_offset * dilations[0]; + for (int h = 0; h < output_height; ++h) { + int h_pad = h * strides[1] - paddings[1] + h_offset * dilations[1]; + for (int w = 0; w < output_width; ++w) { + int w_pad = w * strides[2] - paddings[2] + w_offset * dilations[2]; + + int col_idx = + ((c * output_depth + d) * output_height + h) * output_width + w; + int vol_idx = + ((c_in * input_depth + d_pad) * input_height + h_pad) * + input_width + + w_pad; + col_data[col_idx] = + (h_pad < 0 || h_pad >= input_height || w_pad < 0 || + w_pad >= input_width || d_pad < 0 || d_pad >= input_depth) + ? static_cast(0) + : vol_data[vol_idx]; + } } + } } + } }; /* @@ -119,89 +112,83 @@ template class Vol2ColFunctor { * output_depth, output_height, output_width] */ template class Col2VolFunctor { - public: - void operator()(const Tensor &col, const std::vector &dilations, - const std::vector &strides, - const std::vector &paddings, Tensor *vol) const { - // PADDLE_ENFORCE(vol->dims().size() == 4); - // PADDLE_ENFORCE(col.dims().size() == 7); - - int input_channels = vol->dims()[0]; - int input_depth = vol->dims()[1]; - int input_height = vol->dims()[2]; - int input_width = vol->dims()[3]; - int filter_depth = col.dims()[1]; - int filter_height = col.dims()[2]; - int filter_width = col.dims()[3]; - int output_depth = col.dims()[4]; - int output_height = col.dims()[5]; - int output_width = col.dims()[6]; - int channels_col = - input_channels * filter_depth * filter_height * filter_width; - - // PADDLE_ENFORCE_EQ((input_depth + 2 * paddings[0] - - // ((dilations[0] * (filter_depth - 1) - // + 1))) / - // strides[0] + - // 1, - // output_depth, - // "input_depth and output_depth are " - // "mismatching."); - // PADDLE_ENFORCE_EQ((input_height + 2 * paddings[1] - - // ((dilations[1] * (filter_height - - // 1) + 1))) / - // strides[1] + - // 1, - // output_height, - // "input_height and output_height are - // " - // "mismatching."); - // PADDLE_ENFORCE_EQ((input_width + 2 * paddings[2] - - // ((dilations[2] * (filter_width - 1) - // + 1))) / - // strides[2] + - // 1, - // output_width, - // "input_width and output_width are " - // "mismatching."); - T *vol_data = vol->data(); - const T *col_data = col.data(); - - for (int c = 0; c < channels_col; ++c) { - int w_offset = c % filter_width; - int h_offset = (c / filter_width) % filter_height; - int d_offset = (c / filter_width / filter_height) % filter_depth; - int cIm = c / filter_width / filter_height / filter_depth; - for (int d = 0; d < output_depth; ++d) { - int d_pad = - d * strides[0] - paddings[0] + d_offset * dilations[0]; - for (int h = 0; h < output_height; ++h) { - int h_pad = - h * strides[1] - paddings[1] + h_offset * dilations[1]; - for (int w = 0; w < output_width; ++w) { - int w_pad = w * strides[2] - paddings[2] + - w_offset * dilations[2]; - - if (h_pad >= 0 && h_pad < input_height && w_pad >= 0 && - w_pad < input_width && d_pad >= 0 && - d_pad < input_depth) { - int vol_idx = - ((cIm * input_depth + d_pad) * input_height + - h_pad) * - input_width + - w_pad; - - int col_idx = - ((c * output_depth + d) * output_height + h) * - output_width + - w; - vol_data[vol_idx] += col_data[col_idx]; - } - } - } +public: + void operator()(const Tensor &col, const std::vector &dilations, + const std::vector &strides, + const std::vector &paddings, Tensor *vol) const { + // PADDLE_ENFORCE(vol->dims().size() == 4); + // PADDLE_ENFORCE(col.dims().size() == 7); + + int input_channels = vol->dims()[0]; + int input_depth = vol->dims()[1]; + int input_height = vol->dims()[2]; + int input_width = vol->dims()[3]; + int filter_depth = col.dims()[1]; + int filter_height = col.dims()[2]; + int filter_width = col.dims()[3]; + int output_depth = col.dims()[4]; + int output_height = col.dims()[5]; + int output_width = col.dims()[6]; + int channels_col = + input_channels * filter_depth * filter_height * filter_width; + + // PADDLE_ENFORCE_EQ((input_depth + 2 * paddings[0] - + // ((dilations[0] * (filter_depth - 1) + // + 1))) / + // strides[0] + + // 1, + // output_depth, + // "input_depth and output_depth are " + // "mismatching."); + // PADDLE_ENFORCE_EQ((input_height + 2 * paddings[1] - + // ((dilations[1] * (filter_height - + // 1) + 1))) / + // strides[1] + + // 1, + // output_height, + // "input_height and output_height are + // " + // "mismatching."); + // PADDLE_ENFORCE_EQ((input_width + 2 * paddings[2] - + // ((dilations[2] * (filter_width - 1) + // + 1))) / + // strides[2] + + // 1, + // output_width, + // "input_width and output_width are " + // "mismatching."); + T *vol_data = vol->data(); + const T *col_data = col.data(); + + for (int c = 0; c < channels_col; ++c) { + int w_offset = c % filter_width; + int h_offset = (c / filter_width) % filter_height; + int d_offset = (c / filter_width / filter_height) % filter_depth; + int cIm = c / filter_width / filter_height / filter_depth; + for (int d = 0; d < output_depth; ++d) { + int d_pad = d * strides[0] - paddings[0] + d_offset * dilations[0]; + for (int h = 0; h < output_height; ++h) { + int h_pad = h * strides[1] - paddings[1] + h_offset * dilations[1]; + for (int w = 0; w < output_width; ++w) { + int w_pad = w * strides[2] - paddings[2] + w_offset * dilations[2]; + + if (h_pad >= 0 && h_pad < input_height && w_pad >= 0 && + w_pad < input_width && d_pad >= 0 && d_pad < input_depth) { + int vol_idx = + ((cIm * input_depth + d_pad) * input_height + h_pad) * + input_width + + w_pad; + + int col_idx = + ((c * output_depth + d) * output_height + h) * output_width + + w; + vol_data[vol_idx] += col_data[col_idx]; } + } } + } } + } }; template class Vol2ColFunctor; diff --git a/src/operators/math/vol2col.h b/src/operators/math/vol2col.h index 4daa954e2bed0faad556a65b21ffc891b52d3130..64b81811f01dee5ea2d9a4874a42f7cf36c43a32 100644 --- a/src/operators/math/vol2col.h +++ b/src/operators/math/vol2col.h @@ -73,17 +73,17 @@ namespace math { using Tensor = paddle_mobile::framework::Tensor; template class Vol2ColFunctor { - public: - void operator()(const Tensor &vol, const std::vector &dilations, - const std::vector &strides, - const std::vector &paddings, Tensor *col) const; +public: + void operator()(const Tensor &vol, const std::vector &dilations, + const std::vector &strides, + const std::vector &paddings, Tensor *col) const; }; template class Col2VolFunctor { - public: - void operator()(const Tensor &col, const std::vector &dilations, - const std::vector &strides, - const std::vector &paddings, Tensor *vol) const; +public: + void operator()(const Tensor &col, const std::vector &dilations, + const std::vector &strides, + const std::vector &paddings, Tensor *vol) const; }; } // namespace math diff --git a/src/operators/mul_op.cpp b/src/operators/mul_op.cpp index 42eeb7f0ec9aee5345233d85a9dfc2db779a3e51..056ce696e391b4295fcc12c7a50ffb089ac1123b 100644 --- a/src/operators/mul_op.cpp +++ b/src/operators/mul_op.cpp @@ -22,34 +22,34 @@ namespace paddle_mobile { namespace operators { template void MulOp::InferShape() const { - auto x_dims = param_.InputX()->dims(); - auto y_dims = param_.InputY()->dims(); - int x_num_col_dims = param_.XNumColDims(); - int y_num_col_dims = param_.YNumColDims(); + auto x_dims = param_.InputX()->dims(); + auto y_dims = param_.InputY()->dims(); + int x_num_col_dims = param_.XNumColDims(); + int y_num_col_dims = param_.YNumColDims(); - assert(x_dims.size() > x_num_col_dims); - assert(y_dims.size() > y_num_col_dims); + assert(x_dims.size() > x_num_col_dims); + assert(y_dims.size() > y_num_col_dims); - /// (1,2,3,4) , x_num_col_dims = 2 -> (2,12) - auto x_mat_dims = framework::flatten_to_2d(x_dims, x_num_col_dims); - auto y_mat_dims = framework::flatten_to_2d(y_dims, y_num_col_dims); + /// (1,2,3,4) , x_num_col_dims = 2 -> (2,12) + auto x_mat_dims = framework::flatten_to_2d(x_dims, x_num_col_dims); + auto y_mat_dims = framework::flatten_to_2d(y_dims, y_num_col_dims); - assert(x_mat_dims[1] == y_mat_dims[0]); + assert(x_mat_dims[1] == y_mat_dims[0]); - std::vector output_dims; - output_dims.reserve( - static_cast(x_num_col_dims + y_dims.size() - y_num_col_dims)); + std::vector output_dims; + output_dims.reserve( + static_cast(x_num_col_dims + y_dims.size() - y_num_col_dims)); - for (int i = 0; i < x_num_col_dims; ++i) { - output_dims.push_back(x_dims[i]); - } + for (int i = 0; i < x_num_col_dims; ++i) { + output_dims.push_back(x_dims[i]); + } - for (int i = y_num_col_dims; i < y_dims.size(); ++i) { - output_dims.push_back(y_dims[i]); - } + for (int i = y_num_col_dims; i < y_dims.size(); ++i) { + output_dims.push_back(y_dims[i]); + } - framework::DDim ddim = framework::make_ddim(output_dims); - param_.Out()->Resize(ddim); + framework::DDim ddim = framework::make_ddim(output_dims); + param_.Out()->Resize(ddim); } template class MulOp; } // namespace operators diff --git a/src/operators/mul_op.h b/src/operators/mul_op.h index 835864857a0baf415edfae6ea0585607f2b5172d..055acbf0f70c801030bbcbce6f427312f6645067 100644 --- a/src/operators/mul_op.h +++ b/src/operators/mul_op.h @@ -27,24 +27,24 @@ using namespace framework; template class MulOp : public framework::OperatorWithKernel { - public: - MulOp(const std::string &type, const VariableNameMap &inputs, - const VariableNameMap &outputs, const framework::AttributeMap attrs, - std::shared_ptr scope) - : framework::OperatorWithKernel(type, inputs, outputs, - attrs, scope), - param_(inputs, outputs, attrs, *scope) {} - - void Run() const { - operators::MulKernel kernel; - kernel.Compute(param_); - } - - using framework::OperatorWithKernel::OperatorWithKernel; - void InferShape() const override; - - protected: - MulParam param_; +public: + MulOp(const std::string &type, const VariableNameMap &inputs, + const VariableNameMap &outputs, const framework::AttributeMap attrs, + std::shared_ptr scope) + : framework::OperatorWithKernel(type, inputs, outputs, attrs, + scope), + param_(inputs, outputs, attrs, *scope) {} + + void Run() const { + operators::MulKernel kernel; + kernel.Compute(param_); + } + + using framework::OperatorWithKernel::OperatorWithKernel; + void InferShape() const override; + +protected: + MulParam param_; }; } // namespace operators diff --git a/src/operators/op_param.cpp b/src/operators/op_param.cpp index 6e1510d0e14447e1aec7915ff17deac0e16838ba..80a488150df27ad11a836d54b040368d87e01f66 100644 --- a/src/operators/op_param.cpp +++ b/src/operators/op_param.cpp @@ -21,25 +21,24 @@ SOFTWARE. namespace paddle_mobile { namespace operators { Print &operator<<(Print &printer, const ConvParam &conv_param) { - printer << "parameter of conv: " - << "\n"; - printer << " stride: " - << " (" << conv_param.Strides()[0] << conv_param.Strides()[1] - << ") " - << "\n"; - printer << " paddings: " - << " (" << conv_param.Paddings()[0] << conv_param.Paddings()[1] - << ") " - << "\n"; - printer << " dilations: " - << " (" << conv_param.Dilations()[0] << conv_param.Dilations()[1] - << ") " - << "\n"; - printer << " groups: " << conv_param.Groups() << "\n"; - printer << " input dims: " << conv_param.Input()->dims() << "\n"; - printer << " filter dims: " << conv_param.Filter()->dims() << "\n"; - printer << " output dims: " << conv_param.Output()->dims(); - return printer; + printer << "parameter of conv: " + << "\n"; + printer << " stride: " + << " (" << conv_param.Strides()[0] << conv_param.Strides()[1] << ") " + << "\n"; + printer << " paddings: " + << " (" << conv_param.Paddings()[0] << conv_param.Paddings()[1] + << ") " + << "\n"; + printer << " dilations: " + << " (" << conv_param.Dilations()[0] << conv_param.Dilations()[1] + << ") " + << "\n"; + printer << " groups: " << conv_param.Groups() << "\n"; + printer << " input dims: " << conv_param.Input()->dims() << "\n"; + printer << " filter dims: " << conv_param.Filter()->dims() << "\n"; + printer << " output dims: " << conv_param.Output()->dims(); + return printer; } } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/op_param.h b/src/operators/op_param.h index 7241d9048650192c3f710a836b35b7703c682b80..49996264168d43b9e2a1c5d2ea35b5a85454f95a 100644 --- a/src/operators/op_param.h +++ b/src/operators/op_param.h @@ -31,357 +31,355 @@ namespace operators { using namespace framework; class OpParam : PaddleMobileObject { - public: - protected: - template - static T *InputFrom(const VariableNameMap &inputs, const Scope &scope) { - return GetVarValue("Input", inputs, scope); +public: +protected: + template + static T *InputFrom(const VariableNameMap &inputs, const Scope &scope) { + return GetVarValue("Input", inputs, scope); + } + + template + static T *InputXFrom(const VariableNameMap &inputs, const Scope &scope) { + return GetVarValue("X", inputs, scope); + } + + template + static T *InputYFrom(const VariableNameMap &inputs, const Scope &scope) { + return GetVarValue("Y", inputs, scope); + } + + template + static T *InputBiasFrom(const VariableNameMap &inputs, const Scope &scope) { + return GetVarValue("Bias", inputs, scope); + } + template + static T *InputVarianceFrom(const VariableNameMap &inputs, + const Scope &scope) { + return GetVarValue("Variance", inputs, scope); + } + template + static T *InputMeanFrom(const VariableNameMap &inputs, const Scope &scope) { + return GetVarValue("Mean", inputs, scope); + } + template + static T *InputScaleFrom(const VariableNameMap &inputs, const Scope &scope) { + return GetVarValue("Scale", inputs, scope); + } + + template + static std::vector InputMultiFrom(const VariableNameMap &inputs, + const Scope &scope) { + return GetMultiVarValue("X", inputs, scope); + } + + template + static T *OutputFrom(const VariableNameMap &outputs, const Scope &scope) { + return GetVarValue("Output", outputs, scope); + } + + template + static T *OutFrom(const VariableNameMap &outputs, const Scope &scope) { + return GetVarValue("Out", outputs, scope); + } + + template + static T *OutputYFrom(const VariableNameMap &outputs, const Scope &scope) { + return GetVarValue("Y", outputs, scope); + } + + template + static T *MidOutFrom(const VariableNameMap &outputs, const Scope &scope) { + return GetVarValue("MidOut", outputs, scope); + } + + template + static T *FilterFrom(const VariableNameMap &inputs, const Scope &scope) { + return GetVarValue("Filter", inputs, scope); + } + + template + static const T GetAttr(const std::string &key, const AttributeMap &map) { + return ((Attribute)map.at(key)).Get(); + } + + template + static T *GetVarValue(const std::string &key, const VariableNameMap &var_map, + const Scope &scope) { + auto var_vec = var_map.at(key); + if (!var_vec.empty()) { + // std::cout << " get var value -- " << var_vec[0] << + // std::endl; + auto var = scope.FindVar(var_vec[0]); + return var->GetMutable(); + } else { + return nullptr; } + } - template - static T *InputXFrom(const VariableNameMap &inputs, const Scope &scope) { - return GetVarValue("X", inputs, scope); - } - - template - static T *InputYFrom(const VariableNameMap &inputs, const Scope &scope) { - return GetVarValue("Y", inputs, scope); - } - - template - static T *InputBiasFrom(const VariableNameMap &inputs, const Scope &scope) { - return GetVarValue("Bias", inputs, scope); - } - template - static T *InputVarianceFrom(const VariableNameMap &inputs, - const Scope &scope) { - return GetVarValue("Variance", inputs, scope); - } - template - static T *InputMeanFrom(const VariableNameMap &inputs, const Scope &scope) { - return GetVarValue("Mean", inputs, scope); - } - template - static T *InputScaleFrom(const VariableNameMap &inputs, - const Scope &scope) { - return GetVarValue("Scale", inputs, scope); - } - - template - static std::vector InputMultiFrom(const VariableNameMap &inputs, + template + static std::vector GetMultiVarValue(const std::string &key, + const VariableNameMap &var_map, const Scope &scope) { - return GetMultiVarValue("X", inputs, scope); - } - - template - static T *OutputFrom(const VariableNameMap &outputs, const Scope &scope) { - return GetVarValue("Output", outputs, scope); - } - - template - static T *OutFrom(const VariableNameMap &outputs, const Scope &scope) { - return GetVarValue("Out", outputs, scope); - } - - template - static T *OutputYFrom(const VariableNameMap &outputs, const Scope &scope) { - return GetVarValue("Y", outputs, scope); - } - - template - static T *MidOutFrom(const VariableNameMap &outputs, const Scope &scope) { - return GetVarValue("MidOut", outputs, scope); - } - - template - static T *FilterFrom(const VariableNameMap &inputs, const Scope &scope) { - return GetVarValue("Filter", inputs, scope); - } - - template - static const T GetAttr(const std::string &key, const AttributeMap &map) { - return ((Attribute)map.at(key)).Get(); - } - - template - static T *GetVarValue(const std::string &key, - const VariableNameMap &var_map, const Scope &scope) { - auto var_vec = var_map.at(key); - if (!var_vec.empty()) { - // std::cout << " get var value -- " << var_vec[0] << - // std::endl; - auto var = scope.FindVar(var_vec[0]); - return var->GetMutable(); - } else { - return nullptr; - } - } - - template - static std::vector GetMultiVarValue(const std::string &key, - const VariableNameMap &var_map, - const Scope &scope) { - auto var_vecs = var_map.at(key); - assert(var_vecs.size() > 1); - std::vector var_res; - for (auto &var_vec : var_vecs) { - auto var = scope.FindVar(var_vec); - var_res.push_back(var->GetMutable()); - } - return var_res; + auto var_vecs = var_map.at(key); + assert(var_vecs.size() > 1); + std::vector var_res; + for (auto &var_vec : var_vecs) { + auto var = scope.FindVar(var_vec); + var_res.push_back(var->GetMutable()); } + return var_res; + } }; class ConvParam : OpParam { - public: - ConvParam(const VariableNameMap &inputs, const VariableNameMap &outputs, - const framework::AttributeMap &attrs, - const framework::Scope &scope) { - filter_ = FilterFrom(inputs, scope); - input_ = InputFrom(inputs, scope); - output_ = OutputFrom(outputs, scope); - strides_ = GetAttr>("strides", attrs); - paddings_ = GetAttr>("paddings", attrs); - dilations_ = GetAttr>("dilations", attrs); - groups = GetAttr("groups", attrs); - } +public: + ConvParam(const VariableNameMap &inputs, const VariableNameMap &outputs, + const framework::AttributeMap &attrs, + const framework::Scope &scope) { + filter_ = FilterFrom(inputs, scope); + input_ = InputFrom(inputs, scope); + output_ = OutputFrom(outputs, scope); + strides_ = GetAttr>("strides", attrs); + paddings_ = GetAttr>("paddings", attrs); + dilations_ = GetAttr>("dilations", attrs); + groups = GetAttr("groups", attrs); + } - const Tensor *Input() const { return input_; } + const Tensor *Input() const { return input_; } - const LoDTensor *Filter() const { return filter_; } + const LoDTensor *Filter() const { return filter_; } - Tensor *Output() const { return output_; } + Tensor *Output() const { return output_; } - const std::vector &Strides() const { return strides_; } + const std::vector &Strides() const { return strides_; } - const std::vector &Paddings() const { return paddings_; } + const std::vector &Paddings() const { return paddings_; } - const std::vector &Dilations() const { return dilations_; } + const std::vector &Dilations() const { return dilations_; } - const int &Groups() const { return groups; } + const int &Groups() const { return groups; } - private: - Tensor *input_; - Tensor *output_; - LoDTensor *filter_; - std::vector strides_; - std::vector paddings_; - std::vector dilations_; - int groups; +private: + Tensor *input_; + Tensor *output_; + LoDTensor *filter_; + std::vector strides_; + std::vector paddings_; + std::vector dilations_; + int groups; }; Print &operator<<(Print &printer, const ConvParam &conv_param); class ElementwiseAddParam : OpParam { - public: - ElementwiseAddParam(const VariableNameMap &inputs, - const VariableNameMap &outputs, - const framework::AttributeMap &attrs, - const framework::Scope &scope) { - input_x_ = InputXFrom(inputs, scope); - input_y_ = InputYFrom(inputs, scope); - out_ = OutFrom(outputs, scope); - axis_ = GetAttr("axis", attrs); - } - - const Tensor *InputX() const { return input_x_; } - - const Tensor *InputY() const { return input_y_; } - - Tensor *Out() const { return out_; } - - const int &Axis() const { return axis_; } - - private: - Tensor *input_x_; - Tensor *input_y_; - Tensor *out_; - int axis_; +public: + ElementwiseAddParam(const VariableNameMap &inputs, + const VariableNameMap &outputs, + const framework::AttributeMap &attrs, + const framework::Scope &scope) { + input_x_ = InputXFrom(inputs, scope); + input_y_ = InputYFrom(inputs, scope); + out_ = OutFrom(outputs, scope); + axis_ = GetAttr("axis", attrs); + } + + const Tensor *InputX() const { return input_x_; } + + const Tensor *InputY() const { return input_y_; } + + Tensor *Out() const { return out_; } + + const int &Axis() const { return axis_; } + +private: + Tensor *input_x_; + Tensor *input_y_; + Tensor *out_; + int axis_; }; class MulParam : OpParam { - public: - MulParam(const VariableNameMap &inputs, const VariableNameMap &outputs, - const framework::AttributeMap &attrs, - const framework::Scope &scope) { - input_x_ = InputXFrom(inputs, scope); - input_y_ = InputYFrom(inputs, scope); - out_ = OutFrom(outputs, scope); - x_num_col_dims_ = GetAttr("x_num_col_dims", attrs); - y_num_col_dims_ = GetAttr("y_num_col_dims", attrs); - } +public: + MulParam(const VariableNameMap &inputs, const VariableNameMap &outputs, + const framework::AttributeMap &attrs, + const framework::Scope &scope) { + input_x_ = InputXFrom(inputs, scope); + input_y_ = InputYFrom(inputs, scope); + out_ = OutFrom(outputs, scope); + x_num_col_dims_ = GetAttr("x_num_col_dims", attrs); + y_num_col_dims_ = GetAttr("y_num_col_dims", attrs); + } - const Tensor *InputX() const { return input_x_; } + const Tensor *InputX() const { return input_x_; } - const Tensor *InputY() const { return input_y_; } + const Tensor *InputY() const { return input_y_; } - Tensor *Out() const { return out_; } + Tensor *Out() const { return out_; } - const int &XNumColDims() const { return x_num_col_dims_; } + const int &XNumColDims() const { return x_num_col_dims_; } - const int &YNumColDims() const { return y_num_col_dims_; } + const int &YNumColDims() const { return y_num_col_dims_; } - private: - Tensor *input_x_; - Tensor *input_y_; - Tensor *out_; - int x_num_col_dims_; - int y_num_col_dims_; +private: + Tensor *input_x_; + Tensor *input_y_; + Tensor *out_; + int x_num_col_dims_; + int y_num_col_dims_; }; class ConcatParam : public OpParam { - public: - ConcatParam(const VariableNameMap &inputs, const VariableNameMap &outputs, - const framework::AttributeMap &attrs, - const framework::Scope &scope) { - inputs_ = InputMultiFrom(inputs, scope); - out_ = OutFrom(outputs, scope); - axis_ = GetAttr("axis", attrs); - } +public: + ConcatParam(const VariableNameMap &inputs, const VariableNameMap &outputs, + const framework::AttributeMap &attrs, + const framework::Scope &scope) { + inputs_ = InputMultiFrom(inputs, scope); + out_ = OutFrom(outputs, scope); + axis_ = GetAttr("axis", attrs); + } - std::vector Inputs() const { return inputs_; } + std::vector Inputs() const { return inputs_; } - Tensor *Out() const { return out_; } + Tensor *Out() const { return out_; } - const int &Axis() const { return axis_; } + const int &Axis() const { return axis_; } - private: - std::vector inputs_; - Tensor *out_; - int axis_; +private: + std::vector inputs_; + Tensor *out_; + int axis_; }; class LrnParam : public OpParam { - public: - LrnParam(const VariableNameMap &inputs, const VariableNameMap &outputs, - const framework::AttributeMap &attrs, - const framework::Scope &scope) { - input_x_ = InputXFrom(inputs, scope); - out_ = OutFrom(outputs, scope); - mid_out_ = MidOutFrom(outputs, scope); - n_ = GetAttr("n", attrs); - alpha_ = GetAttr("alpha", attrs); - beta_ = GetAttr("beta", attrs); - k_ = GetAttr("k", attrs); - data_format_ = GetAttr("data_format", attrs); - } +public: + LrnParam(const VariableNameMap &inputs, const VariableNameMap &outputs, + const framework::AttributeMap &attrs, + const framework::Scope &scope) { + input_x_ = InputXFrom(inputs, scope); + out_ = OutFrom(outputs, scope); + mid_out_ = MidOutFrom(outputs, scope); + n_ = GetAttr("n", attrs); + alpha_ = GetAttr("alpha", attrs); + beta_ = GetAttr("beta", attrs); + k_ = GetAttr("k", attrs); + data_format_ = GetAttr("data_format", attrs); + } - const Tensor *InputX() const { return input_x_; } + const Tensor *InputX() const { return input_x_; } - Tensor *Out() const { return out_; } + Tensor *Out() const { return out_; } - Tensor *MidOut() const { return mid_out_; } + Tensor *MidOut() const { return mid_out_; } - const int &N() const { return n_; } + const int &N() const { return n_; } - const float &Alpha() const { return alpha_; } + const float &Alpha() const { return alpha_; } - const float &Beta() const { return beta_; } + const float &Beta() const { return beta_; } - const float &K() const { return k_; } + const float &K() const { return k_; } - const std::string &DataFormat() const { return data_format_; } + const std::string &DataFormat() const { return data_format_; } - private: - Tensor *input_x_; - Tensor *out_; - Tensor *mid_out_; - int n_; - float alpha_; - float beta_; - float k_; - std::string data_format_; +private: + Tensor *input_x_; + Tensor *out_; + Tensor *mid_out_; + int n_; + float alpha_; + float beta_; + float k_; + std::string data_format_; }; class BatchNormParam : OpParam { - public: - BatchNormParam(const VariableNameMap &inputs, - const VariableNameMap &outputs, - const framework::AttributeMap &attrs, - const framework::Scope &scope) { - input_x_ = InputXFrom(inputs, scope); - output_y_ = OutputYFrom(outputs, scope); - input_bias_ = InputBiasFrom(inputs, scope); - input_mean_ = InputMeanFrom(inputs, scope); - input_scale_ = InputScaleFrom(inputs, scope); - input_variance_ = InputVarianceFrom(inputs, scope); - epsilon_ = GetAttr("epsilon", attrs); - momentum_ = GetAttr("momentum", attrs); - is_test_ = GetAttr("is_test", attrs); - } +public: + BatchNormParam(const VariableNameMap &inputs, const VariableNameMap &outputs, + const framework::AttributeMap &attrs, + const framework::Scope &scope) { + input_x_ = InputXFrom(inputs, scope); + output_y_ = OutputYFrom(outputs, scope); + input_bias_ = InputBiasFrom(inputs, scope); + input_mean_ = InputMeanFrom(inputs, scope); + input_scale_ = InputScaleFrom(inputs, scope); + input_variance_ = InputVarianceFrom(inputs, scope); + epsilon_ = GetAttr("epsilon", attrs); + momentum_ = GetAttr("momentum", attrs); + is_test_ = GetAttr("is_test", attrs); + } - const Tensor *InputX() const { return input_x_; } + const Tensor *InputX() const { return input_x_; } - Tensor *OutputY() const { return output_y_; } + Tensor *OutputY() const { return output_y_; } - const Tensor *InputBias() const { return input_bias_; } + const Tensor *InputBias() const { return input_bias_; } - const Tensor *InputMean() const { return input_mean_; } + const Tensor *InputMean() const { return input_mean_; } - const Tensor *InputScale() const { return input_scale_; } + const Tensor *InputScale() const { return input_scale_; } - const Tensor *InputVariance() const { return input_variance_; } + const Tensor *InputVariance() const { return input_variance_; } - const float &Epsilon() const { return epsilon_; } + const float &Epsilon() const { return epsilon_; } - const float &Momentum() const { return momentum_; } + const float &Momentum() const { return momentum_; } - const bool &IsTest() const { return is_test_; } + const bool &IsTest() const { return is_test_; } - const std::string &DataFormat() const { return data_format_; } + const std::string &DataFormat() const { return data_format_; } - private: - Tensor *input_x_; - Tensor *output_y_; - Tensor *input_bias_; - Tensor *input_mean_; - Tensor *input_scale_; - Tensor *input_variance_; - float epsilon_; - float momentum_; - bool is_test_; - std::string data_format_; +private: + Tensor *input_x_; + Tensor *output_y_; + Tensor *input_bias_; + Tensor *input_mean_; + Tensor *input_scale_; + Tensor *input_variance_; + float epsilon_; + float momentum_; + bool is_test_; + std::string data_format_; }; class PoolParam : public OpParam { - public: - PoolParam(const VariableNameMap &inputs, const VariableNameMap &outputs, - const framework::AttributeMap &attrs, - const framework::Scope &scope) { - input_ = InputXFrom(inputs, scope); - - output_ = OutFrom(outputs, scope); - pooling_type_ = GetAttr("pooling_type", attrs); - ksize_ = GetAttr>("ksize", attrs); - strides_ = GetAttr>("strides", attrs); - paddings_ = GetAttr>("paddings", attrs); - ceil_mode_ = GetAttr("ceil_mode", attrs); - gloabal_pooling_ = GetAttr("global_pooling", attrs); - } +public: + PoolParam(const VariableNameMap &inputs, const VariableNameMap &outputs, + const framework::AttributeMap &attrs, + const framework::Scope &scope) { + input_ = InputXFrom(inputs, scope); + + output_ = OutFrom(outputs, scope); + pooling_type_ = GetAttr("pooling_type", attrs); + ksize_ = GetAttr>("ksize", attrs); + strides_ = GetAttr>("strides", attrs); + paddings_ = GetAttr>("paddings", attrs); + ceil_mode_ = GetAttr("ceil_mode", attrs); + gloabal_pooling_ = GetAttr("global_pooling", attrs); + } - const Tensor *Input() const { return input_; } + const Tensor *Input() const { return input_; } - Tensor *Output() const { return output_; } + Tensor *Output() const { return output_; } - const std::string &PoolingType() const { return pooling_type_; } + const std::string &PoolingType() const { return pooling_type_; } - const std::vector &Ksize() const { return ksize_; } + const std::vector &Ksize() const { return ksize_; } - const std::vector &Strides() const { return strides_; } + const std::vector &Strides() const { return strides_; } - const std::vector &Paddings() const { return paddings_; } + const std::vector &Paddings() const { return paddings_; } - bool isCeilMode() const { return ceil_mode_; } + bool isCeilMode() const { return ceil_mode_; } - bool isGlobalPooling() const { return gloabal_pooling_; } + bool isGlobalPooling() const { return gloabal_pooling_; } - private: - Tensor *input_; - Tensor *output_; - std::string pooling_type_; - std::vector ksize_; - std::vector strides_; - std::vector paddings_; - bool ceil_mode_; - bool gloabal_pooling_ = false; +private: + Tensor *input_; + Tensor *output_; + std::string pooling_type_; + std::vector ksize_; + std::vector strides_; + std::vector paddings_; + bool ceil_mode_; + bool gloabal_pooling_ = false; }; } // namespace operators diff --git a/src/operators/pool_op.cpp b/src/operators/pool_op.cpp index 692e4215068b47cbd2a147ff3eeb8ff2b4772f0a..d93c66f9bad333bcae7613f733f0e41d85c17880 100644 --- a/src/operators/pool_op.cpp +++ b/src/operators/pool_op.cpp @@ -23,37 +23,37 @@ namespace operators { int PoolOutputSize(int input_size, int filter_size, int padding, int stride, bool ceil_mode) { - int output_size; - if (!ceil_mode) { - output_size = (input_size - filter_size + 2 * padding) / stride + 1; - } else { - output_size = - (input_size - filter_size + 2 * padding + stride - 1) / stride + 1; - } - return output_size; + int output_size; + if (!ceil_mode) { + output_size = (input_size - filter_size + 2 * padding) / stride + 1; + } else { + output_size = + (input_size - filter_size + 2 * padding + stride - 1) / stride + 1; + } + return output_size; } template void PoolOp::InferShape() const { - auto in_x_dims = param_.Input()->dims(); - std::vector ksize = param_.Ksize(); - std::vector paddings = param_.Paddings(); - std::vector strides = param_.Strides(); - bool ceil_mode = param_.isCeilMode(); + auto in_x_dims = param_.Input()->dims(); + std::vector ksize = param_.Ksize(); + std::vector paddings = param_.Paddings(); + std::vector strides = param_.Strides(); + bool ceil_mode = param_.isCeilMode(); - if (param_.isGlobalPooling()) { - ksize.resize(static_cast(in_x_dims.size()) - 2); - for (size_t i = 0; i < ksize.size(); ++i) { - paddings[i] = 0; - ksize[i] = static_cast(in_x_dims[i + 2]); - } - } - std::vector output_shape({in_x_dims[0], in_x_dims[1]}); + if (param_.isGlobalPooling()) { + ksize.resize(static_cast(in_x_dims.size()) - 2); for (size_t i = 0; i < ksize.size(); ++i) { - output_shape.push_back(PoolOutputSize( - in_x_dims[i + 2], ksize[i], paddings[i], strides[i], ceil_mode)); + paddings[i] = 0; + ksize[i] = static_cast(in_x_dims[i + 2]); } - param_.Output()->Resize(framework::make_ddim(output_shape)); - DLOG << "infer shape out size =" << param_.Output()->numel(); + } + std::vector output_shape({in_x_dims[0], in_x_dims[1]}); + for (size_t i = 0; i < ksize.size(); ++i) { + output_shape.push_back(PoolOutputSize(in_x_dims[i + 2], ksize[i], + paddings[i], strides[i], ceil_mode)); + } + param_.Output()->Resize(framework::make_ddim(output_shape)); + DLOG << "infer shape out size =" << param_.Output()->numel(); } template class PoolOp; } // namespace operators diff --git a/src/operators/pool_op.h b/src/operators/pool_op.h index ea5d9953e4f9d3bc230f3bb9453aa6a35990a3d7..09f7ec5d8d78b5358feca2de4386e2355f6ca2e9 100644 --- a/src/operators/pool_op.h +++ b/src/operators/pool_op.h @@ -28,25 +28,25 @@ using namespace framework; template class PoolOp : public framework::OperatorWithKernel { - public: - PoolOp(const std::string &type, const VariableNameMap &inputs, - const VariableNameMap &outputs, const framework::AttributeMap &attrs, - std::shared_ptr scope) - : framework::OperatorWithKernel(type, inputs, outputs, - attrs, scope), - param_(inputs, outputs, attrs, *scope) {} - using framework::OperatorWithKernel::OperatorWithKernel; - void InferShape() const override; +public: + PoolOp(const std::string &type, const VariableNameMap &inputs, + const VariableNameMap &outputs, const framework::AttributeMap &attrs, + std::shared_ptr scope) + : framework::OperatorWithKernel(type, inputs, outputs, attrs, + scope), + param_(inputs, outputs, attrs, *scope) {} + using framework::OperatorWithKernel::OperatorWithKernel; + void InferShape() const override; - void Run() const { - // InferShape(); - operators::PoolKernel kernel; - kernel.Compute(param_); - this->ClearVariables({"X"}); - } + void Run() const { + // InferShape(); + operators::PoolKernel kernel; + kernel.Compute(param_); + this->ClearVariables({"X"}); + } - private: - PoolParam param_; +private: + PoolParam param_; }; } // namespace operators } // namespace paddle_mobile diff --git a/src/platform/data_type.h b/src/platform/data_type.h index 5e7ba31e45f1894434fa1f9c6b6d214cad73cb65..e8e5fd317b304bfd29f90da0a31db4ada336d06a 100644 --- a/src/platform/data_type.h +++ b/src/platform/data_type.h @@ -22,103 +22,103 @@ namespace paddle_mobile { namespace framework { inline proto::VarType::Type ToDataType(std::type_index type) { - /*if (typeid(platform::float16).hash_code() == type.hash_code()) { - return proto::VarType::FP16; - } else */ - if (typeid(const float).hash_code() == type.hash_code()) { - // CPPLint complains Using C-style cast. Use - // static_cast() instead - // One fix to this is to replace float with const float because - // typeid(T) == typeid(const T) - // http://en.cppreference.com/w/cpp/language/typeid - return proto::VarType::FP32; - } else if (typeid(const double).hash_code() == type.hash_code()) { - return proto::VarType::FP64; - } else if (typeid(const int).hash_code() == type.hash_code()) { - return proto::VarType::INT32; - } else if (typeid(const int64_t).hash_code() == type.hash_code()) { - return proto::VarType::INT64; - } else if (typeid(const bool).hash_code() == type.hash_code()) { - return proto::VarType::BOOL; - } else { - // PADDLE_THROW("Not supported"); - // std::cout << "Not supported"; - } + /*if (typeid(platform::float16).hash_code() == type.hash_code()) { + return proto::VarType::FP16; + } else */ + if (typeid(const float).hash_code() == type.hash_code()) { + // CPPLint complains Using C-style cast. Use + // static_cast() instead + // One fix to this is to replace float with const float because + // typeid(T) == typeid(const T) + // http://en.cppreference.com/w/cpp/language/typeid + return proto::VarType::FP32; + } else if (typeid(const double).hash_code() == type.hash_code()) { + return proto::VarType::FP64; + } else if (typeid(const int).hash_code() == type.hash_code()) { + return proto::VarType::INT32; + } else if (typeid(const int64_t).hash_code() == type.hash_code()) { + return proto::VarType::INT64; + } else if (typeid(const bool).hash_code() == type.hash_code()) { + return proto::VarType::BOOL; + } else { + // PADDLE_THROW("Not supported"); + // std::cout << "Not supported"; + } } inline std::type_index ToTypeIndex(proto::VarType::Type type) { - switch (type) { - // case proto::VarType::FP16: - // return typeid(platform::float16); - case proto::VarType::FP32: - return typeid(float); - case proto::VarType::FP64: - return typeid(double); - case proto::VarType::INT32: - return typeid(int); - case proto::VarType::INT64: - return typeid(int64_t); - case proto::VarType::BOOL: - return typeid(bool); - default: - // PADDLE_THROW("Not support type %d", type); - printf("Not support type %d", type); - } + switch (type) { + // case proto::VarType::FP16: + // return typeid(platform::float16); + case proto::VarType::FP32: + return typeid(float); + case proto::VarType::FP64: + return typeid(double); + case proto::VarType::INT32: + return typeid(int); + case proto::VarType::INT64: + return typeid(int64_t); + case proto::VarType::BOOL: + return typeid(bool); + default: + // PADDLE_THROW("Not support type %d", type); + printf("Not support type %d", type); + } } template inline void VisitDataType(proto::VarType::Type type, Visitor visitor) { - switch (type) { - // case proto::VarType::FP16: - // visitor.template operator()(); - // break; - case proto::VarType::FP32: - visitor.template operator()(); - break; - case proto::VarType::FP64: - visitor.template operator()(); - break; - case proto::VarType::INT32: - visitor.template operator()(); - break; - case proto::VarType::INT64: - visitor.template operator()(); - break; - case proto::VarType::BOOL: - visitor.template operator()(); - break; - default: - // PADDLE_THROW("Not supported"); - printf("Not supported"); - } + switch (type) { + // case proto::VarType::FP16: + // visitor.template operator()(); + // break; + case proto::VarType::FP32: + visitor.template operator()(); + break; + case proto::VarType::FP64: + visitor.template operator()(); + break; + case proto::VarType::INT32: + visitor.template operator()(); + break; + case proto::VarType::INT64: + visitor.template operator()(); + break; + case proto::VarType::BOOL: + visitor.template operator()(); + break; + default: + // PADDLE_THROW("Not supported"); + printf("Not supported"); + } } inline std::string DataTypeToString(const proto::VarType::Type type) { - switch (type) { - case proto::VarType::FP16: - return "float16"; - case proto::VarType::FP32: - return "float32"; - case proto::VarType::FP64: - return "float64"; - case proto::VarType::INT16: - return "int16"; - case proto::VarType::INT32: - return "int32"; - case proto::VarType::INT64: - return "int64"; - case proto::VarType::BOOL: - return "bool"; - default: - // PADDLE_THROW("Not support type %d", type); - printf("Not support type %d", type); - } + switch (type) { + case proto::VarType::FP16: + return "float16"; + case proto::VarType::FP32: + return "float32"; + case proto::VarType::FP64: + return "float64"; + case proto::VarType::INT16: + return "int16"; + case proto::VarType::INT32: + return "int32"; + case proto::VarType::INT64: + return "int64"; + case proto::VarType::BOOL: + return "bool"; + default: + // PADDLE_THROW("Not support type %d", type); + printf("Not support type %d", type); + } } inline std::ostream &operator<<(std::ostream &out, const proto::VarType::Type &type) { - out << DataTypeToString(type); - return out; + out << DataTypeToString(type); + return out; } } // namespace framework diff --git a/src/platform/macros.h b/src/platform/macros.h index f34b8a7dc91fb783995fb0f4fdf001231c741a52..2f81e9409625dfb11b9d438f1ee531fa710f4f6b 100644 --- a/src/platform/macros.h +++ b/src/platform/macros.h @@ -17,9 +17,9 @@ limitations under the License. */ // Disable the copy and assignment operator for a class. #ifndef DISABLE_COPY_AND_ASSIGN #define DISABLE_COPY_AND_ASSIGN(classname) \ - private: \ - classname(const classname &) = delete; \ - classname(classname &&) = delete; \ - classname &operator=(const classname &) = delete; \ - classname &operator=(classname &&) = delete +private: \ + classname(const classname &) = delete; \ + classname(classname &&) = delete; \ + classname &operator=(const classname &) = delete; \ + classname &operator=(classname &&) = delete #endif diff --git a/test/common/test_log.cpp b/test/common/test_log.cpp index a6c76a612d085b4c4cf1e213d81f76724a4a1b88..4195be67ce17c3d660439714f4b878cc6c6407d8 100644 --- a/test/common/test_log.cpp +++ b/test/common/test_log.cpp @@ -20,20 +20,20 @@ SOFTWARE. int main() { - DLOGF("DASJFDAFJ%d -- %f", 12345, 344.234); + DLOGF("DASJFDAFJ%d -- %f", 12345, 344.234); - LOGF(paddle_mobile::kLOG_DEBUG, "DASJFDAFJ%d -- %f", 12345, 344.234); + LOGF(paddle_mobile::kLOG_DEBUG, "DASJFDAFJ%d -- %f", 12345, 344.234); - LOG(paddle_mobile::kLOG_DEBUG) << "test debug" - << " next log"; + LOG(paddle_mobile::kLOG_DEBUG) << "test debug" + << " next log"; - LOG(paddle_mobile::kLOG_DEBUG1) << "test debug1" - << " next log"; - LOG(paddle_mobile::kLOG_DEBUG2) << "test debug2" - << " next log"; - DLOG << "test DLOG"; + LOG(paddle_mobile::kLOG_DEBUG1) << "test debug1" + << " next log"; + LOG(paddle_mobile::kLOG_DEBUG2) << "test debug2" + << " next log"; + DLOG << "test DLOG"; - LOG(paddle_mobile::kLOG_ERROR) << " error occur !"; + LOG(paddle_mobile::kLOG_ERROR) << " error occur !"; - return 0; + return 0; } diff --git a/test/framework/executor_for_test.cpp b/test/framework/executor_for_test.cpp index 6348c491c9924752901b30bd2e29a0963c3af7b6..0de18694acaa9a55c43923a2ed1b76e5a61a8031 100644 --- a/test/framework/executor_for_test.cpp +++ b/test/framework/executor_for_test.cpp @@ -23,29 +23,29 @@ Executor4Test::Executor4Test(const Program p, std::string op_type) : Executor(p) { - if (this->program_.originProgram == nullptr) { - LOG(paddle_mobile::LogLevel::kLOG_ERROR) - << "to_predict_program_ == nullptr"; - } + if (this->program_.originProgram == nullptr) { + LOG(paddle_mobile::LogLevel::kLOG_ERROR) + << "to_predict_program_ == nullptr"; + } - const std::vector> blocks = - this->to_predict_program_->Blocks(); + const std::vector> blocks = + this->to_predict_program_->Blocks(); - for (int i = 0; i < blocks.size(); ++i) { - std::shared_ptr block_desc = blocks[i]; - std::vector> ops = block_desc->Ops(); - for (int j = 0; j < ops.size(); ++j) { - std::shared_ptr op = ops[j]; - if (op->Type() == op_type) { - std::shared_ptr op_ptr = std::make_shared( - op->Type(), op->GetInputs(), op->GetOutputs(), - op->GetAttrMap(), this->program_.scope); + for (int i = 0; i < blocks.size(); ++i) { + std::shared_ptr block_desc = blocks[i]; + std::vector> ops = block_desc->Ops(); + for (int j = 0; j < ops.size(); ++j) { + std::shared_ptr op = ops[j]; + if (op->Type() == op_type) { + std::shared_ptr op_ptr = std::make_shared( + op->Type(), op->GetInputs(), op->GetOutputs(), op->GetAttrMap(), + this->program_.scope); - this->ops_of_block_[*block_desc.get()].push_back(op_ptr); - break; - } - } + this->ops_of_block_[*block_desc.get()].push_back(op_ptr); + break; + } } + } } template @@ -53,19 +53,19 @@ std::shared_ptr Executor4Test::predict(Tensor &t, std::string input, std::string output, DDim dDim) { - auto scope = this->program_.scope; - Variable *g_feed_value = scope->Var(input); - auto tensor = g_feed_value->GetMutable(); - tensor->ShareDataWith(t); + auto scope = this->program_.scope; + Variable *g_feed_value = scope->Var(input); + auto tensor = g_feed_value->GetMutable(); + tensor->ShareDataWith(t); - Variable *con_output = scope->Var(output); - Tensor *output_tensor = con_output->GetMutable(); - output_tensor->mutable_data(dDim); - std::shared_ptr out_tensor = std::make_shared(); - out_tensor.reset(output_tensor); + Variable *con_output = scope->Var(output); + Tensor *output_tensor = con_output->GetMutable(); + output_tensor->mutable_data(dDim); + std::shared_ptr out_tensor = std::make_shared(); + out_tensor.reset(output_tensor); - Executor::predict(t, 0); - return out_tensor; + Executor::predict(t, 0); + return out_tensor; } template class Executor4Test< diff --git a/test/framework/executor_for_test.h b/test/framework/executor_for_test.h index 381fd03f150b2c74cd97ec75224028c4a03dbb04..5b35127ad11bec0e82048e552c16e6aab338d036 100644 --- a/test/framework/executor_for_test.h +++ b/test/framework/executor_for_test.h @@ -27,9 +27,9 @@ using namespace paddle_mobile::framework; template class Executor4Test : public Executor { - public: - Executor4Test(const Program p, std::string op_type); +public: + Executor4Test(const Program p, std::string op_type); - std::shared_ptr predict(Tensor &t, std::string input, - std::string output, DDim dDim); + std::shared_ptr predict(Tensor &t, std::string input, + std::string output, DDim dDim); }; diff --git a/test/framework/test_load.cpp b/test/framework/test_load.cpp index 8b341867e4b26977528f83b1cfd11bd1d86f2e53..153429bae6a910780e9a09cc4f76e249df8aa65d 100644 --- a/test/framework/test_load.cpp +++ b/test/framework/test_load.cpp @@ -19,10 +19,10 @@ SOFTWARE. #include "io.h" int main() { - paddle_mobile::Loader loader; + paddle_mobile::Loader loader; - //../../../test/models/googlenet - //../../../test/models/mobilenet - auto program = loader.Load(std::string("../models/googlenet")); - return 0; + //../../../test/models/googlenet + //../../../test/models/mobilenet + auto program = loader.Load(std::string("../models/googlenet")); + return 0; } \ No newline at end of file diff --git a/test/framework/test_optimize.cpp b/test/framework/test_optimize.cpp index 87e0e2b2072909725fa3e7cb6fa4ba4f77855acb..f11531f8adfb17b12ee9f6381f3110842e96685c 100644 --- a/test/framework/test_optimize.cpp +++ b/test/framework/test_optimize.cpp @@ -25,16 +25,16 @@ using namespace paddle_mobile::framework; int main() { - Loader loader; - // "../../../test/models/googlenet" - auto program = loader.Load("../models/googlenet"); + Loader loader; + // "../../../test/models/googlenet" + auto program = loader.Load("../models/googlenet"); - ProgramOptimize optimize; + ProgramOptimize optimize; - auto optimize_program = optimize.FushionOptimize(program.originProgram); - if (optimize_program) { + auto optimize_program = optimize.FushionOptimize(program.originProgram); + if (optimize_program) { - } else { - DLOG << "optimize_program is null"; - } + } else { + DLOG << "optimize_program is null"; + } } diff --git a/test/operators/test_batchnorm_op.cpp b/test/operators/test_batchnorm_op.cpp index ddc7a38067a2cb8bc6c0ebf6c851b049163a31b6..9b9389c502cb6425adaf36f1fe368080c634ef62 100644 --- a/test/operators/test_batchnorm_op.cpp +++ b/test/operators/test_batchnorm_op.cpp @@ -24,102 +24,100 @@ namespace paddle_mobile { namespace framework { template class TestBatchNormOp { - public: - explicit TestBatchNormOp(const Program p) : program_(p) { - if (use_optimize_) { - to_predict_program_ = program_.optimizeProgram; - } else { - to_predict_program_ = program_.originProgram; - } - - const std::vector> blocks = - to_predict_program_->Blocks(); - // DLOG << " **block size " << blocks.size(); - for (int i = 0; i < blocks.size(); ++i) { - std::shared_ptr block_desc = blocks[i]; - std::vector> ops = block_desc->Ops(); - // DLOG << " ops " << ops.size(); - for (int j = 0; j < ops.size(); ++j) { - std::shared_ptr op = ops[j]; - if (op->Type() == "batch_norm" && - op->Input("X")[0] == "conv2d_0.tmp_0") { - DLOG << " mul attr size: " << op->GetAttrMap().size(); - DLOG << " inputs size: " << op->GetInputs().size(); - DLOG << " outputs size: " << op->GetOutputs().size(); - DLOG << " Input X is : " << op->Input("X")[0]; - DLOG << " Input Mean is : " << op->Input("Mean")[0]; - DLOG << " Input Variance is : " << op->Input("Variance")[0]; - DLOG << " Input Scale is : " << op->Input("Scale")[0]; - DLOG << " Input Bias is : " << op->Input("Bias")[0]; - DLOG << " Output Y is : " << op->Output("Y")[0]; - DLOG << " epsilon : " - << op->GetAttrMap().at("epsilon").Get(); - std::shared_ptr> lrn = - std::make_shared>( - op->Type(), op->GetInputs(), op->GetOutputs(), - op->GetAttrMap(), program_.scope); - ops_of_block_[*block_desc.get()].push_back(lrn); - } - } - } +public: + explicit TestBatchNormOp(const Program p) : program_(p) { + if (use_optimize_) { + to_predict_program_ = program_.optimizeProgram; + } else { + to_predict_program_ = program_.originProgram; } - std::shared_ptr predict_bn(Tensor &t1, Tensor &t2, Tensor &t3, - Tensor &t4, Tensor &t5) { - // feed - auto scope = program_.scope; - Variable *x1_feed_value = scope->Var("conv2d_0.tmp_0"); - auto tensor_x1 = x1_feed_value->GetMutable(); - tensor_x1->ShareDataWith(t1); - - Variable *mean_feed_value = scope->Var("batch_norm_0.w_1"); - auto tensor_mean = mean_feed_value->GetMutable(); - tensor_mean->ShareDataWith(t2); - - Variable *scale_feed_value = scope->Var("batch_norm_0.w_0"); - auto tensor_scale = scale_feed_value->GetMutable(); - tensor_scale->ShareDataWith(t3); - - Variable *variance_feed_value = scope->Var("batch_norm_0.w_2"); - auto tensor_variance = variance_feed_value->GetMutable(); - tensor_variance->ShareDataWith(t4); - - Variable *bias_feed_value = scope->Var("batch_norm_0.b_0"); - auto tensor_bias = bias_feed_value->GetMutable(); - tensor_bias->ShareDataWith(t5); - - Variable *output = scope->Var("batch_norm_0.tmp_2"); - auto *output_tensor = output->GetMutable(); - output_tensor->mutable_data({4, 10, 2, 2}); - // DLOG << typeid(output_tensor).name(); - // DLOG << "output_tensor dims: " << output_tensor->dims(); - - std::shared_ptr out_tensor = std::make_shared(); - out_tensor.reset(output_tensor); - - predict_bn(t1, t2, t3, t4, t5, 0); - return out_tensor; - } - - private: - const framework::Program program_; - std::shared_ptr to_predict_program_; - std::map>>> - ops_of_block_; - bool use_optimize_ = false; - - void predict_bn(const Tensor &t1, const Tensor &t2, const Tensor &t3, - const Tensor &t4, const Tensor &t5, int block_id) { - std::shared_ptr to_predict_block = - to_predict_program_->Block(block_id); - for (int j = 0; j < ops_of_block_[*to_predict_block.get()].size(); - ++j) { - auto op = ops_of_block_[*to_predict_block.get()][j]; - DLOG << "op -> run()"; - op->Run(); + const std::vector> blocks = + to_predict_program_->Blocks(); + // DLOG << " **block size " << blocks.size(); + for (int i = 0; i < blocks.size(); ++i) { + std::shared_ptr block_desc = blocks[i]; + std::vector> ops = block_desc->Ops(); + // DLOG << " ops " << ops.size(); + for (int j = 0; j < ops.size(); ++j) { + std::shared_ptr op = ops[j]; + if (op->Type() == "batch_norm" && + op->Input("X")[0] == "conv2d_0.tmp_0") { + DLOG << " mul attr size: " << op->GetAttrMap().size(); + DLOG << " inputs size: " << op->GetInputs().size(); + DLOG << " outputs size: " << op->GetOutputs().size(); + DLOG << " Input X is : " << op->Input("X")[0]; + DLOG << " Input Mean is : " << op->Input("Mean")[0]; + DLOG << " Input Variance is : " << op->Input("Variance")[0]; + DLOG << " Input Scale is : " << op->Input("Scale")[0]; + DLOG << " Input Bias is : " << op->Input("Bias")[0]; + DLOG << " Output Y is : " << op->Output("Y")[0]; + DLOG << " epsilon : " << op->GetAttrMap().at("epsilon").Get(); + std::shared_ptr> lrn = + std::make_shared>( + op->Type(), op->GetInputs(), op->GetOutputs(), + op->GetAttrMap(), program_.scope); + ops_of_block_[*block_desc.get()].push_back(lrn); } + } + } + } + + std::shared_ptr predict_bn(Tensor &t1, Tensor &t2, Tensor &t3, + Tensor &t4, Tensor &t5) { + // feed + auto scope = program_.scope; + Variable *x1_feed_value = scope->Var("conv2d_0.tmp_0"); + auto tensor_x1 = x1_feed_value->GetMutable(); + tensor_x1->ShareDataWith(t1); + + Variable *mean_feed_value = scope->Var("batch_norm_0.w_1"); + auto tensor_mean = mean_feed_value->GetMutable(); + tensor_mean->ShareDataWith(t2); + + Variable *scale_feed_value = scope->Var("batch_norm_0.w_0"); + auto tensor_scale = scale_feed_value->GetMutable(); + tensor_scale->ShareDataWith(t3); + + Variable *variance_feed_value = scope->Var("batch_norm_0.w_2"); + auto tensor_variance = variance_feed_value->GetMutable(); + tensor_variance->ShareDataWith(t4); + + Variable *bias_feed_value = scope->Var("batch_norm_0.b_0"); + auto tensor_bias = bias_feed_value->GetMutable(); + tensor_bias->ShareDataWith(t5); + + Variable *output = scope->Var("batch_norm_0.tmp_2"); + auto *output_tensor = output->GetMutable(); + output_tensor->mutable_data({4, 10, 2, 2}); + // DLOG << typeid(output_tensor).name(); + // DLOG << "output_tensor dims: " << output_tensor->dims(); + + std::shared_ptr out_tensor = std::make_shared(); + out_tensor.reset(output_tensor); + + predict_bn(t1, t2, t3, t4, t5, 0); + return out_tensor; + } + +private: + const framework::Program program_; + std::shared_ptr to_predict_program_; + std::map>>> + ops_of_block_; + bool use_optimize_ = false; + + void predict_bn(const Tensor &t1, const Tensor &t2, const Tensor &t3, + const Tensor &t4, const Tensor &t5, int block_id) { + std::shared_ptr to_predict_block = + to_predict_program_->Block(block_id); + for (int j = 0; j < ops_of_block_[*to_predict_block.get()].size(); ++j) { + auto op = ops_of_block_[*to_predict_block.get()][j]; + DLOG << "op -> run()"; + op->Run(); } + } }; template class TestBatchNormOp; @@ -127,50 +125,48 @@ template class TestBatchNormOp; } // namespace paddle_mobile int main() { - DLOG << "----------**********----------"; - DLOG << "begin to run BatchNormOp Test"; - paddle_mobile::Loader loader; - auto program = loader.Load(std::string( - "../../test/models/image_classification_resnet.inference.model")); - - /// input x (4,10,2,2) - paddle_mobile::framework::Tensor inputx1; - SetupTensor(&inputx1, {4, 10, 2, 2}, static_cast(0), - static_cast(1)); - auto *inputx1_ptr = inputx1.data(); - - paddle_mobile::framework::Tensor mean; - SetupTensor(&mean, {10}, static_cast(0), - static_cast(1)); - auto *mean_ptr = mean.data(); - - paddle_mobile::framework::Tensor scale; - SetupTensor(&scale, {10}, static_cast(0), - static_cast(1)); - auto *scale_ptr = scale.data(); - - paddle_mobile::framework::Tensor variance; - SetupTensor(&variance, {10}, static_cast(0), - static_cast(1)); - auto *variance_ptr = variance.data(); - - paddle_mobile::framework::Tensor bias; - SetupTensor(&bias, {10}, static_cast(0), - static_cast(1)); - auto *bias_ptr = bias.data(); - - paddle_mobile::framework::TestBatchNormOp - testBatchNormOp(program); - - auto output_bn = - testBatchNormOp.predict_bn(inputx1, mean, scale, variance, bias); - auto *output_bn_ptr = output_bn->data(); - - /// [2, 5, 1, 0] - DLOG << " (" << inputx1_ptr[102] << " - " << mean_ptr[5] << ")/((" - << variance_ptr[5] << " + 0.00001" - << ")^0.5)* " << scale_ptr[5] << " + " << bias_ptr[5] << " = "; - DLOG << output_bn_ptr[102]; - - return 0; + DLOG << "----------**********----------"; + DLOG << "begin to run BatchNormOp Test"; + paddle_mobile::Loader loader; + auto program = loader.Load(std::string( + "../../test/models/image_classification_resnet.inference.model")); + + /// input x (4,10,2,2) + paddle_mobile::framework::Tensor inputx1; + SetupTensor(&inputx1, {4, 10, 2, 2}, static_cast(0), + static_cast(1)); + auto *inputx1_ptr = inputx1.data(); + + paddle_mobile::framework::Tensor mean; + SetupTensor(&mean, {10}, static_cast(0), static_cast(1)); + auto *mean_ptr = mean.data(); + + paddle_mobile::framework::Tensor scale; + SetupTensor(&scale, {10}, static_cast(0), + static_cast(1)); + auto *scale_ptr = scale.data(); + + paddle_mobile::framework::Tensor variance; + SetupTensor(&variance, {10}, static_cast(0), + static_cast(1)); + auto *variance_ptr = variance.data(); + + paddle_mobile::framework::Tensor bias; + SetupTensor(&bias, {10}, static_cast(0), static_cast(1)); + auto *bias_ptr = bias.data(); + + paddle_mobile::framework::TestBatchNormOp testBatchNormOp( + program); + + auto output_bn = + testBatchNormOp.predict_bn(inputx1, mean, scale, variance, bias); + auto *output_bn_ptr = output_bn->data(); + + /// [2, 5, 1, 0] + DLOG << " (" << inputx1_ptr[102] << " - " << mean_ptr[5] << ")/((" + << variance_ptr[5] << " + 0.00001" + << ")^0.5)* " << scale_ptr[5] << " + " << bias_ptr[5] << " = "; + DLOG << output_bn_ptr[102]; + + return 0; } diff --git a/test/operators/test_concat_op.cpp b/test/operators/test_concat_op.cpp index d3c97a5e84c950dbeba698c871162a1088a97219..c778f33a2e77e3714ab2b09efd931ebd87782784 100644 --- a/test/operators/test_concat_op.cpp +++ b/test/operators/test_concat_op.cpp @@ -24,95 +24,92 @@ namespace paddle_mobile { namespace framework { template class TestConcatOp { - public: - explicit TestConcatOp(const Program p) : program_(p) { - if (use_optimize_) { - to_predict_program_ = program_.optimizeProgram; - } else { - to_predict_program_ = program_.originProgram; - } - - const std::vector> blocks = - to_predict_program_->Blocks(); - // DLOG << " **block size " << blocks.size(); - for (int i = 0; i < blocks.size(); ++i) { - std::shared_ptr block_desc = blocks[i]; - std::vector> ops = block_desc->Ops(); - // DLOG << " ops " << ops.size(); - for (int j = 0; j < ops.size(); ++j) { - std::shared_ptr op = ops[j]; - if (op->Type() == "concat" && - op->Input("X")[0] == "conv2d_3.tmp_1") { - DLOG << " mul attr size: " << op->GetAttrMap().size(); - DLOG << " inputs size: " << op->GetInputs().size(); - DLOG << " outputs size: " << op->GetOutputs().size(); - DLOG << " Input X is : " << op->Input("X")[0]; - DLOG << " Output Out is : " << op->Output("Out")[0]; - DLOG << " axis : " - << op->GetAttrMap().at("axis").Get(); - - std::shared_ptr> concat = - std::make_shared>( - op->Type(), op->GetInputs(), op->GetOutputs(), - op->GetAttrMap(), program_.scope); - ops_of_block_[*block_desc.get()].push_back(concat); - } - } - } +public: + explicit TestConcatOp(const Program p) : program_(p) { + if (use_optimize_) { + to_predict_program_ = program_.optimizeProgram; + } else { + to_predict_program_ = program_.originProgram; } - std::shared_ptr predict_concat(Tensor &t1, Tensor &t2, Tensor &t3, - Tensor &t4) { - // feed - auto scope = program_.scope; - Variable *x1_feed_value = scope->Var("conv2d_3.tmp_1"); - auto tensor_x1 = x1_feed_value->GetMutable(); - tensor_x1->ShareDataWith(t1); - - Variable *x2_feed_value = scope->Var("conv2d_5.tmp_1"); - auto tensor_x2 = x2_feed_value->GetMutable(); - tensor_x2->ShareDataWith(t2); - - Variable *x3_feed_value = scope->Var("conv2d_7.tmp_1"); - auto tensor_x3 = x3_feed_value->GetMutable(); - tensor_x3->ShareDataWith(t3); - - Variable *x4_feed_value = scope->Var("conv2d_8.tmp_1"); - auto tensor_x4 = x4_feed_value->GetMutable(); - tensor_x4->ShareDataWith(t4); - - Variable *con_output = scope->Var("concat_0.tmp_0"); - auto *output_tensor = con_output->GetMutable(); - output_tensor->mutable_data({4, 100, 2, 2}); - // DLOG << typeid(output_tensor).name(); - // DLOG << "output_tensor dims: " << output_tensor->dims(); - - std::shared_ptr out_tensor = std::make_shared(); - out_tensor.reset(output_tensor); - - predict_concat(t1, t2, t3, t4, 0); - return out_tensor; - } - - private: - const framework::Program program_; - std::shared_ptr to_predict_program_; - std::map>>> - ops_of_block_; - bool use_optimize_ = false; - - void predict_concat(const Tensor &t1, const Tensor &t2, const Tensor &t3, - const Tensor &t4, int block_id) { - std::shared_ptr to_predict_block = - to_predict_program_->Block(block_id); - for (int j = 0; j < ops_of_block_[*to_predict_block.get()].size(); - ++j) { - auto op = ops_of_block_[*to_predict_block.get()][j]; - DLOG << "op -> run()"; - op->Run(); + const std::vector> blocks = + to_predict_program_->Blocks(); + // DLOG << " **block size " << blocks.size(); + for (int i = 0; i < blocks.size(); ++i) { + std::shared_ptr block_desc = blocks[i]; + std::vector> ops = block_desc->Ops(); + // DLOG << " ops " << ops.size(); + for (int j = 0; j < ops.size(); ++j) { + std::shared_ptr op = ops[j]; + if (op->Type() == "concat" && op->Input("X")[0] == "conv2d_3.tmp_1") { + DLOG << " mul attr size: " << op->GetAttrMap().size(); + DLOG << " inputs size: " << op->GetInputs().size(); + DLOG << " outputs size: " << op->GetOutputs().size(); + DLOG << " Input X is : " << op->Input("X")[0]; + DLOG << " Output Out is : " << op->Output("Out")[0]; + DLOG << " axis : " << op->GetAttrMap().at("axis").Get(); + + std::shared_ptr> concat = + std::make_shared>( + op->Type(), op->GetInputs(), op->GetOutputs(), + op->GetAttrMap(), program_.scope); + ops_of_block_[*block_desc.get()].push_back(concat); } + } + } + } + + std::shared_ptr predict_concat(Tensor &t1, Tensor &t2, Tensor &t3, + Tensor &t4) { + // feed + auto scope = program_.scope; + Variable *x1_feed_value = scope->Var("conv2d_3.tmp_1"); + auto tensor_x1 = x1_feed_value->GetMutable(); + tensor_x1->ShareDataWith(t1); + + Variable *x2_feed_value = scope->Var("conv2d_5.tmp_1"); + auto tensor_x2 = x2_feed_value->GetMutable(); + tensor_x2->ShareDataWith(t2); + + Variable *x3_feed_value = scope->Var("conv2d_7.tmp_1"); + auto tensor_x3 = x3_feed_value->GetMutable(); + tensor_x3->ShareDataWith(t3); + + Variable *x4_feed_value = scope->Var("conv2d_8.tmp_1"); + auto tensor_x4 = x4_feed_value->GetMutable(); + tensor_x4->ShareDataWith(t4); + + Variable *con_output = scope->Var("concat_0.tmp_0"); + auto *output_tensor = con_output->GetMutable(); + output_tensor->mutable_data({4, 100, 2, 2}); + // DLOG << typeid(output_tensor).name(); + // DLOG << "output_tensor dims: " << output_tensor->dims(); + + std::shared_ptr out_tensor = std::make_shared(); + out_tensor.reset(output_tensor); + + predict_concat(t1, t2, t3, t4, 0); + return out_tensor; + } + +private: + const framework::Program program_; + std::shared_ptr to_predict_program_; + std::map>>> + ops_of_block_; + bool use_optimize_ = false; + + void predict_concat(const Tensor &t1, const Tensor &t2, const Tensor &t3, + const Tensor &t4, int block_id) { + std::shared_ptr to_predict_block = + to_predict_program_->Block(block_id); + for (int j = 0; j < ops_of_block_[*to_predict_block.get()].size(); ++j) { + auto op = ops_of_block_[*to_predict_block.get()][j]; + DLOG << "op -> run()"; + op->Run(); } + } }; template class TestConcatOp; @@ -120,60 +117,59 @@ template class TestConcatOp; } // namespace paddle_mobile int main() { - DLOG << "----------**********----------"; - DLOG << "begin to run ConcatOp Test"; - paddle_mobile::Loader loader; - auto program = loader.Load(std::string("../../test/models/googlenet")); - - /// input x (4,10,2,2) - paddle_mobile::framework::Tensor inputx1; - SetupTensor(&inputx1, {4, 10, 2, 2}, static_cast(0), - static_cast(1)); - auto *inputx1_ptr = inputx1.data(); - /// input x (4,20,2,2) - paddle_mobile::framework::Tensor inputx2; - SetupTensor(&inputx2, {4, 20, 2, 2}, static_cast(0), - static_cast(1)); - auto *inputx2_ptr = inputx2.data(); - /// input x (4,30,2,2) - paddle_mobile::framework::Tensor inputx3; - SetupTensor(&inputx3, {4, 30, 2, 2}, static_cast(0), - static_cast(1)); - auto *inputx3_ptr = inputx3.data(); - /// input x (4,40,2,2) - paddle_mobile::framework::Tensor inputx4; - SetupTensor(&inputx4, {4, 40, 2, 2}, static_cast(0), - static_cast(1)); - auto *inputx4_ptr = inputx4.data(); - - paddle_mobile::framework::TestConcatOp testConcatOp( - program); - - auto output_concat = - testConcatOp.predict_concat(inputx1, inputx2, inputx3, inputx4); - auto *output_concat_ptr = output_concat->data(); - - int input_n = 1; - int input_c = 2; - int input_h = 0; - int input_w = 1; - int stride0 = inputx3.numel() / inputx3.dims()[0]; - int stride1 = inputx3.numel() / inputx3.dims()[0] / inputx3.dims()[1]; - int stride2 = inputx3.dims()[3]; - /// inputx1 (4,10,2,2), - /// inputx2 (4,20,2,2), - /// inputx3 (4,30,2,2), - /// inputx4 (4,40,2,2), - /// axis = 1 - /// output (4,100,2,2) - int input_index = - input_n * stride0 + input_c * stride1 + input_h * stride2 + input_w; - int output_index = - input_n * 100 * 2 * 2 + - (input_c + inputx1.dims()[1] + inputx2.dims()[1]) * 2 * 2 + - input_h * 2 + input_w; - - DLOG << " inputx3[1,2,0,1] = " << inputx3_ptr[input_index]; - DLOG << " output[1,12,0,1] = " << output_concat_ptr[output_index]; - return 0; + DLOG << "----------**********----------"; + DLOG << "begin to run ConcatOp Test"; + paddle_mobile::Loader loader; + auto program = loader.Load(std::string("../../test/models/googlenet")); + + /// input x (4,10,2,2) + paddle_mobile::framework::Tensor inputx1; + SetupTensor(&inputx1, {4, 10, 2, 2}, static_cast(0), + static_cast(1)); + auto *inputx1_ptr = inputx1.data(); + /// input x (4,20,2,2) + paddle_mobile::framework::Tensor inputx2; + SetupTensor(&inputx2, {4, 20, 2, 2}, static_cast(0), + static_cast(1)); + auto *inputx2_ptr = inputx2.data(); + /// input x (4,30,2,2) + paddle_mobile::framework::Tensor inputx3; + SetupTensor(&inputx3, {4, 30, 2, 2}, static_cast(0), + static_cast(1)); + auto *inputx3_ptr = inputx3.data(); + /// input x (4,40,2,2) + paddle_mobile::framework::Tensor inputx4; + SetupTensor(&inputx4, {4, 40, 2, 2}, static_cast(0), + static_cast(1)); + auto *inputx4_ptr = inputx4.data(); + + paddle_mobile::framework::TestConcatOp testConcatOp( + program); + + auto output_concat = + testConcatOp.predict_concat(inputx1, inputx2, inputx3, inputx4); + auto *output_concat_ptr = output_concat->data(); + + int input_n = 1; + int input_c = 2; + int input_h = 0; + int input_w = 1; + int stride0 = inputx3.numel() / inputx3.dims()[0]; + int stride1 = inputx3.numel() / inputx3.dims()[0] / inputx3.dims()[1]; + int stride2 = inputx3.dims()[3]; + /// inputx1 (4,10,2,2), + /// inputx2 (4,20,2,2), + /// inputx3 (4,30,2,2), + /// inputx4 (4,40,2,2), + /// axis = 1 + /// output (4,100,2,2) + int input_index = + input_n * stride0 + input_c * stride1 + input_h * stride2 + input_w; + int output_index = input_n * 100 * 2 * 2 + + (input_c + inputx1.dims()[1] + inputx2.dims()[1]) * 2 * 2 + + input_h * 2 + input_w; + + DLOG << " inputx3[1,2,0,1] = " << inputx3_ptr[input_index]; + DLOG << " output[1,12,0,1] = " << output_concat_ptr[output_index]; + return 0; } diff --git a/test/operators/test_cov_op.cpp b/test/operators/test_cov_op.cpp index 00af04d47db7ab740908420bc6cf0402c9615d1b..57c07a4807b944e5560c4c8472fab7eebb21cc96 100644 --- a/test/operators/test_cov_op.cpp +++ b/test/operators/test_cov_op.cpp @@ -21,26 +21,26 @@ SOFTWARE. #include "io.h" int main() { - paddle_mobile::Loader loader; - auto program = loader.Load(std::string("../models/googlenet")); - if (program.originProgram == nullptr) { - DLOG << "program file read fail"; - } + paddle_mobile::Loader loader; + auto program = loader.Load(std::string("../models/googlenet")); + if (program.originProgram == nullptr) { + DLOG << "program file read fail"; + } - Executor4Test> - executor(program, "conv2d"); + Executor4Test> + executor(program, "conv2d"); - paddle_mobile::framework::Tensor input; - SetupTensor(&input, {1, 3, 32, 32}, static_cast(0), - static_cast(1)); + paddle_mobile::framework::Tensor input; + SetupTensor(&input, {1, 3, 32, 32}, static_cast(0), + static_cast(1)); - auto output = - executor.predict(input, "data", "conv2d_0.tmp_0", {1, 64, 56, 56}); + auto output = + executor.predict(input, "data", "conv2d_0.tmp_0", {1, 64, 56, 56}); - float *output_ptr = output->data(); - for (int j = 0; j < output->numel(); ++j) { - DLOG << " value of output: " << output_ptr[j]; - } - return 0; + float *output_ptr = output->data(); + for (int j = 0; j < output->numel(); ++j) { + DLOG << " value of output: " << output_ptr[j]; + } + return 0; } diff --git a/test/operators/test_elementwise_add_op.cpp b/test/operators/test_elementwise_add_op.cpp index 081a3fe0d00abfb6bba927f1f15f3a5a0bf402b6..afed761540d521c04f2640b01fb6e120d1e6a563 100644 --- a/test/operators/test_elementwise_add_op.cpp +++ b/test/operators/test_elementwise_add_op.cpp @@ -24,127 +24,124 @@ namespace paddle_mobile { namespace framework { template class TestElementwiseAddOp { - public: - explicit TestElementwiseAddOp(const Program p) : program_(p) { - if (use_optimize_) { - to_predict_program_ = program_.optimizeProgram; - } else { - to_predict_program_ = program_.originProgram; - } - - const std::vector> blocks = - to_predict_program_->Blocks(); - // DLOG << " **block size " << blocks.size(); - for (int i = 0; i < blocks.size(); ++i) { - std::shared_ptr block_desc = blocks[i]; - std::vector> ops = block_desc->Ops(); - // DLOG << " ops " << ops.size(); - for (int j = 0; j < ops.size(); ++j) { - std::shared_ptr op = ops[j]; - if (op->Type() == "elementwise_add" && - op->Input("X")[0] == "batch_norm_2.tmp_2") { - DLOG << " elementwise_add attr size: " - << op->GetAttrMap().size(); - DLOG << " inputs size: " << op->GetInputs().size(); - DLOG << " outputs size: " << op->GetOutputs().size(); - DLOG << " Input X is : " << op->Input("X")[0]; - DLOG << " Input Y is : " << op->Input("Y")[0]; - DLOG << " Output Out is : " << op->Output("Out")[0]; - Attribute axis_attr = op->GetAttrMap().at("axis"); - int axis = axis_attr.Get(); - DLOG << " Attr axis is : " << axis; - - std::shared_ptr> - add = std::make_shared< - operators::ElementwiseAddOp>( - op->Type(), op->GetInputs(), op->GetOutputs(), - op->GetAttrMap(), program_.scope); - ops_of_block_[*block_desc.get()].push_back(add); - } - } - } - } - - std::shared_ptr predict_add(Tensor &t1, Tensor &t2) { - // feed - auto scope = program_.scope; - Variable *x_feed_value = scope->Var("batch_norm_2.tmp_2"); - auto tensor_x = x_feed_value->GetMutable(); - tensor_x->ShareDataWith(t1); - - Variable *y_feed_value = scope->Var("batch_norm_0.tmp_3"); - auto tensor_y = y_feed_value->GetMutable(); - tensor_y->ShareDataWith(t2); - - Variable *con_output = scope->Var("elementwise_add_0.tmp_0"); - auto *output_tensor = con_output->GetMutable(); - output_tensor->mutable_data({1, 3, 224, 224}); - // DLOG << typeid(output_tensor).name(); - // DLOG << "output_tensor dims: " << output_tensor->dims(); - - std::shared_ptr out_tensor = std::make_shared(); - out_tensor.reset(output_tensor); - - predict_add(t1, t2, 0); - return out_tensor; +public: + explicit TestElementwiseAddOp(const Program p) : program_(p) { + if (use_optimize_) { + to_predict_program_ = program_.optimizeProgram; + } else { + to_predict_program_ = program_.originProgram; } - private: - const framework::Program program_; - std::shared_ptr to_predict_program_; - std::map>>> - ops_of_block_; - bool use_optimize_ = false; - - void predict_add(const Tensor &t1, const Tensor &t2, int block_id) { - std::shared_ptr to_predict_block = - to_predict_program_->Block(block_id); - for (int j = 0; j < ops_of_block_[*to_predict_block.get()].size(); - ++j) { - auto op = ops_of_block_[*to_predict_block.get()][j]; - DLOG << "op -> run()"; - op->Run(); + const std::vector> blocks = + to_predict_program_->Blocks(); + // DLOG << " **block size " << blocks.size(); + for (int i = 0; i < blocks.size(); ++i) { + std::shared_ptr block_desc = blocks[i]; + std::vector> ops = block_desc->Ops(); + // DLOG << " ops " << ops.size(); + for (int j = 0; j < ops.size(); ++j) { + std::shared_ptr op = ops[j]; + if (op->Type() == "elementwise_add" && + op->Input("X")[0] == "batch_norm_2.tmp_2") { + DLOG << " elementwise_add attr size: " << op->GetAttrMap().size(); + DLOG << " inputs size: " << op->GetInputs().size(); + DLOG << " outputs size: " << op->GetOutputs().size(); + DLOG << " Input X is : " << op->Input("X")[0]; + DLOG << " Input Y is : " << op->Input("Y")[0]; + DLOG << " Output Out is : " << op->Output("Out")[0]; + Attribute axis_attr = op->GetAttrMap().at("axis"); + int axis = axis_attr.Get(); + DLOG << " Attr axis is : " << axis; + + std::shared_ptr> add = + std::make_shared>( + op->Type(), op->GetInputs(), op->GetOutputs(), + op->GetAttrMap(), program_.scope); + ops_of_block_[*block_desc.get()].push_back(add); } + } + } + } + + std::shared_ptr predict_add(Tensor &t1, Tensor &t2) { + // feed + auto scope = program_.scope; + Variable *x_feed_value = scope->Var("batch_norm_2.tmp_2"); + auto tensor_x = x_feed_value->GetMutable(); + tensor_x->ShareDataWith(t1); + + Variable *y_feed_value = scope->Var("batch_norm_0.tmp_3"); + auto tensor_y = y_feed_value->GetMutable(); + tensor_y->ShareDataWith(t2); + + Variable *con_output = scope->Var("elementwise_add_0.tmp_0"); + auto *output_tensor = con_output->GetMutable(); + output_tensor->mutable_data({1, 3, 224, 224}); + // DLOG << typeid(output_tensor).name(); + // DLOG << "output_tensor dims: " << output_tensor->dims(); + + std::shared_ptr out_tensor = std::make_shared(); + out_tensor.reset(output_tensor); + + predict_add(t1, t2, 0); + return out_tensor; + } + +private: + const framework::Program program_; + std::shared_ptr to_predict_program_; + std::map>>> + ops_of_block_; + bool use_optimize_ = false; + + void predict_add(const Tensor &t1, const Tensor &t2, int block_id) { + std::shared_ptr to_predict_block = + to_predict_program_->Block(block_id); + for (int j = 0; j < ops_of_block_[*to_predict_block.get()].size(); ++j) { + auto op = ops_of_block_[*to_predict_block.get()][j]; + DLOG << "op -> run()"; + op->Run(); } + } }; template class TestElementwiseAddOp; } // namespace framework } // namespace paddle_mobile int main() { - DLOG << "----------**********----------"; - DLOG << "begin to run ElementAddOp Test"; - paddle_mobile::Loader loader; - auto program = - loader.Load(std::string("../../test/models/" - "image_classification_resnet.inference.model")); - - /// input x (1,3,224,224) - paddle_mobile::framework::Tensor inputx; - SetupTensor(&inputx, {1, 3, 224, 224}, static_cast(0), - static_cast(1)); - auto *inputx_ptr = inputx.data(); - /// input y (224,) - paddle_mobile::framework::Tensor inputy; - SetupTensor(&inputy, {224}, static_cast(0), - static_cast(1)); - auto *inputy_ptr = inputy.data(); - - paddle_mobile::framework::TestElementwiseAddOp - testElementwiseAddOp(program); - - auto output_add = testElementwiseAddOp.predict_add(inputx, inputy); - auto *output_add_ptr = output_add->data(); - // for (int j = 0; j < output_add->numel(); ++j) { - // DLOG << "value of output: " << output_add_ptr[j]; - // } - - /// output (1,3,224,224) - DLOG << "output memory size : " << output_add->memory_size(); - DLOG << "output numel : " << output_add->numel(); - - DLOG << inputx_ptr[226] << " + " << inputy_ptr[2] << " = " - << output_add_ptr[226]; - return 0; + DLOG << "----------**********----------"; + DLOG << "begin to run ElementAddOp Test"; + paddle_mobile::Loader loader; + auto program = + loader.Load(std::string("../../test/models/" + "image_classification_resnet.inference.model")); + + /// input x (1,3,224,224) + paddle_mobile::framework::Tensor inputx; + SetupTensor(&inputx, {1, 3, 224, 224}, static_cast(0), + static_cast(1)); + auto *inputx_ptr = inputx.data(); + /// input y (224,) + paddle_mobile::framework::Tensor inputy; + SetupTensor(&inputy, {224}, static_cast(0), + static_cast(1)); + auto *inputy_ptr = inputy.data(); + + paddle_mobile::framework::TestElementwiseAddOp + testElementwiseAddOp(program); + + auto output_add = testElementwiseAddOp.predict_add(inputx, inputy); + auto *output_add_ptr = output_add->data(); + // for (int j = 0; j < output_add->numel(); ++j) { + // DLOG << "value of output: " << output_add_ptr[j]; + // } + + /// output (1,3,224,224) + DLOG << "output memory size : " << output_add->memory_size(); + DLOG << "output numel : " << output_add->numel(); + + DLOG << inputx_ptr[226] << " + " << inputy_ptr[2] << " = " + << output_add_ptr[226]; + return 0; } diff --git a/test/operators/test_lrn_op.cpp b/test/operators/test_lrn_op.cpp index 2ff06e1390bcb09296d56ac57aed6360ac788ad0..847aaa9c9d1ae9d25cd6ae9291ddf073734190e2 100644 --- a/test/operators/test_lrn_op.cpp +++ b/test/operators/test_lrn_op.cpp @@ -24,84 +24,80 @@ namespace paddle_mobile { namespace framework { template class TestLrnOp { - public: - explicit TestLrnOp(const Program p) : program_(p) { - if (use_optimize_) { - to_predict_program_ = program_.optimizeProgram; - } else { - to_predict_program_ = program_.originProgram; - } - - const std::vector> blocks = - to_predict_program_->Blocks(); - // DLOG << " **block size " << blocks.size(); - for (int i = 0; i < blocks.size(); ++i) { - std::shared_ptr block_desc = blocks[i]; - std::vector> ops = block_desc->Ops(); - // DLOG << " ops " << ops.size(); - for (int j = 0; j < ops.size(); ++j) { - std::shared_ptr op = ops[j]; - if (op->Type() == "lrn" && - op->Input("X")[0] == "pool2d_0.tmp_0") { - DLOG << " mul attr size: " << op->GetAttrMap().size(); - DLOG << " inputs size: " << op->GetInputs().size(); - DLOG << " outputs size: " << op->GetOutputs().size(); - DLOG << " Input X is : " << op->Input("X")[0]; - DLOG << " Output Out is : " << op->Output("Out")[0]; - DLOG << " n : " << op->GetAttrMap().at("n").Get(); - DLOG << " alpha : " - << op->GetAttrMap().at("alpha").Get(); - DLOG << " beta : " - << op->GetAttrMap().at("beta").Get(); - DLOG << " k : " << op->GetAttrMap().at("k").Get(); - std::shared_ptr> lrn = - std::make_shared>( - op->Type(), op->GetInputs(), op->GetOutputs(), - op->GetAttrMap(), program_.scope); - ops_of_block_[*block_desc.get()].push_back(lrn); - } - } - } +public: + explicit TestLrnOp(const Program p) : program_(p) { + if (use_optimize_) { + to_predict_program_ = program_.optimizeProgram; + } else { + to_predict_program_ = program_.originProgram; } - std::shared_ptr predict_lrn(Tensor &t1) { - // feed - auto scope = program_.scope; - Variable *x1_feed_value = scope->Var("pool2d_0.tmp_0"); - auto tensor_x1 = x1_feed_value->GetMutable(); - tensor_x1->ShareDataWith(t1); - - Variable *con_output = scope->Var("pool1_norm1.tmp_1"); - auto *output_tensor = con_output->GetMutable(); - output_tensor->mutable_data({3, 4, 2, 2}); - // DLOG << typeid(output_tensor).name(); - // DLOG << "output_tensor dims: " << output_tensor->dims(); - - std::shared_ptr out_tensor = std::make_shared(); - out_tensor.reset(output_tensor); - - predict_lrn(t1, 0); - return out_tensor; - } - - private: - const framework::Program program_; - std::shared_ptr to_predict_program_; - std::map>>> - ops_of_block_; - bool use_optimize_ = false; - - void predict_lrn(const Tensor &t1, int block_id) { - std::shared_ptr to_predict_block = - to_predict_program_->Block(block_id); - for (int j = 0; j < ops_of_block_[*to_predict_block.get()].size(); - ++j) { - auto op = ops_of_block_[*to_predict_block.get()][j]; - DLOG << "op -> run()"; - op->Run(); + const std::vector> blocks = + to_predict_program_->Blocks(); + // DLOG << " **block size " << blocks.size(); + for (int i = 0; i < blocks.size(); ++i) { + std::shared_ptr block_desc = blocks[i]; + std::vector> ops = block_desc->Ops(); + // DLOG << " ops " << ops.size(); + for (int j = 0; j < ops.size(); ++j) { + std::shared_ptr op = ops[j]; + if (op->Type() == "lrn" && op->Input("X")[0] == "pool2d_0.tmp_0") { + DLOG << " mul attr size: " << op->GetAttrMap().size(); + DLOG << " inputs size: " << op->GetInputs().size(); + DLOG << " outputs size: " << op->GetOutputs().size(); + DLOG << " Input X is : " << op->Input("X")[0]; + DLOG << " Output Out is : " << op->Output("Out")[0]; + DLOG << " n : " << op->GetAttrMap().at("n").Get(); + DLOG << " alpha : " << op->GetAttrMap().at("alpha").Get(); + DLOG << " beta : " << op->GetAttrMap().at("beta").Get(); + DLOG << " k : " << op->GetAttrMap().at("k").Get(); + std::shared_ptr> lrn = + std::make_shared>( + op->Type(), op->GetInputs(), op->GetOutputs(), + op->GetAttrMap(), program_.scope); + ops_of_block_[*block_desc.get()].push_back(lrn); } + } + } + } + + std::shared_ptr predict_lrn(Tensor &t1) { + // feed + auto scope = program_.scope; + Variable *x1_feed_value = scope->Var("pool2d_0.tmp_0"); + auto tensor_x1 = x1_feed_value->GetMutable(); + tensor_x1->ShareDataWith(t1); + + Variable *con_output = scope->Var("pool1_norm1.tmp_1"); + auto *output_tensor = con_output->GetMutable(); + output_tensor->mutable_data({3, 4, 2, 2}); + // DLOG << typeid(output_tensor).name(); + // DLOG << "output_tensor dims: " << output_tensor->dims(); + + std::shared_ptr out_tensor = std::make_shared(); + out_tensor.reset(output_tensor); + + predict_lrn(t1, 0); + return out_tensor; + } + +private: + const framework::Program program_; + std::shared_ptr to_predict_program_; + std::map>>> + ops_of_block_; + bool use_optimize_ = false; + + void predict_lrn(const Tensor &t1, int block_id) { + std::shared_ptr to_predict_block = + to_predict_program_->Block(block_id); + for (int j = 0; j < ops_of_block_[*to_predict_block.get()].size(); ++j) { + auto op = ops_of_block_[*to_predict_block.get()][j]; + DLOG << "op -> run()"; + op->Run(); } + } }; template class TestLrnOp; @@ -109,51 +105,50 @@ template class TestLrnOp; } // namespace paddle_mobile int main() { - DLOG << "----------**********----------"; - DLOG << "begin to run LrnOp Test"; - paddle_mobile::Loader loader; - auto program = loader.Load(std::string("../../test/models/googlenet")); - - /// input x (3,4,2,2) - paddle_mobile::framework::Tensor inputx1; - SetupTensor(&inputx1, {3, 4, 2, 2}, static_cast(0), - static_cast(1)); - auto *inputx1_ptr = inputx1.data(); - - paddle_mobile::framework::TestLrnOp testLrnOp(program); - - auto output_lrn = testLrnOp.predict_lrn(inputx1); - auto *output_lrn_ptr = output_lrn->data(); - - DLOG << " LrnOp input: "; - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 4; j++) { - for (int c = 0; c < 2; c++) { - for (int d = 0; d < 2; d++) { - DLOGF("%f ", inputx1_ptr[i * 16 + j * 4 + c * 2 + d]); - } - DLOGF("\n"); - } - DLOGF("\n"); + DLOG << "----------**********----------"; + DLOG << "begin to run LrnOp Test"; + paddle_mobile::Loader loader; + auto program = loader.Load(std::string("../../test/models/googlenet")); + + /// input x (3,4,2,2) + paddle_mobile::framework::Tensor inputx1; + SetupTensor(&inputx1, {3, 4, 2, 2}, static_cast(0), + static_cast(1)); + auto *inputx1_ptr = inputx1.data(); + + paddle_mobile::framework::TestLrnOp testLrnOp(program); + + auto output_lrn = testLrnOp.predict_lrn(inputx1); + auto *output_lrn_ptr = output_lrn->data(); + + DLOG << " LrnOp input: "; + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 4; j++) { + for (int c = 0; c < 2; c++) { + for (int d = 0; d < 2; d++) { + DLOGF("%f ", inputx1_ptr[i * 16 + j * 4 + c * 2 + d]); } DLOGF("\n"); + } + DLOGF("\n"); } - DLOG << " LrnOp output: "; - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 4; j++) { - for (int c = 0; c < 2; c++) { - for (int d = 0; d < 2; d++) { - DLOGF("%f ", output_lrn_ptr[i * 16 + j * 4 + c * 2 + d]); - } - DLOGF("\n"); - } - DLOGF("\n"); + DLOGF("\n"); + } + DLOG << " LrnOp output: "; + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 4; j++) { + for (int c = 0; c < 2; c++) { + for (int d = 0; d < 2; d++) { + DLOGF("%f ", output_lrn_ptr[i * 16 + j * 4 + c * 2 + d]); } DLOGF("\n"); + } + DLOGF("\n"); } - DLOG << inputx1_ptr[0] << " / ((1 + 0.00002 * ( " << inputx1_ptr[0] - << "^2 + " << inputx1_ptr[4] << "^2 + " << inputx1_ptr[8] - << "^2 ))^0.75) = "; - DLOG << output_lrn_ptr[0]; - return 0; + DLOGF("\n"); + } + DLOG << inputx1_ptr[0] << " / ((1 + 0.00002 * ( " << inputx1_ptr[0] << "^2 + " + << inputx1_ptr[4] << "^2 + " << inputx1_ptr[8] << "^2 ))^0.75) = "; + DLOG << output_lrn_ptr[0]; + return 0; } diff --git a/test/operators/test_mul_op.cpp b/test/operators/test_mul_op.cpp index a6aab354834ae52398f5cdabd5a6e23d11709dc0..e18ff43ff77e122c67cd22c81c2836ac48848380 100644 --- a/test/operators/test_mul_op.cpp +++ b/test/operators/test_mul_op.cpp @@ -24,88 +24,86 @@ namespace paddle_mobile { namespace framework { template class TestMulOp { - public: - explicit TestMulOp(const Program p) : program_(p) { - if (use_optimize_) { - to_predict_program_ = program_.optimizeProgram; - } else { - to_predict_program_ = program_.originProgram; - } - - const std::vector> blocks = - to_predict_program_->Blocks(); - // DLOG << " **block size " << blocks.size(); - for (int i = 0; i < blocks.size(); ++i) { - std::shared_ptr block_desc = blocks[i]; - std::vector> ops = block_desc->Ops(); - // DLOG << " ops " << ops.size(); - for (int j = 0; j < ops.size(); ++j) { - std::shared_ptr op = ops[j]; - if (op->Type() == "mul" && - op->Input("X")[0] == "pool2d_0.tmp_0") { - DLOG << " mul attr size: " << op->GetAttrMap().size(); - DLOG << " inputs size: " << op->GetInputs().size(); - DLOG << " outputs size: " << op->GetOutputs().size(); - DLOG << " Input X is : " << op->Input("X")[0]; - DLOG << " Input Y is : " << op->Input("Y")[0]; - DLOG << " Output Out is : " << op->Output("Out")[0]; - DLOG << "x_num_col_dims : " - << op->GetAttrMap().at("x_num_col_dims").Get(); - DLOG << "y_num_col_dims : " - << op->GetAttrMap().at("y_num_col_dims").Get(); - - std::shared_ptr> mul = - std::make_shared>( - op->Type(), op->GetInputs(), op->GetOutputs(), - op->GetAttrMap(), program_.scope); - ops_of_block_[*block_desc.get()].push_back(mul); - } - } - } +public: + explicit TestMulOp(const Program p) : program_(p) { + if (use_optimize_) { + to_predict_program_ = program_.optimizeProgram; + } else { + to_predict_program_ = program_.originProgram; } - std::shared_ptr predict_mul(Tensor &t1, Tensor &t2) { - // feed - auto scope = program_.scope; - Variable *x_feed_value = scope->Var("pool2d_0.tmp_0"); - auto tensor_x = x_feed_value->GetMutable(); - tensor_x->ShareDataWith(t1); - - Variable *y_feed_value = scope->Var("fc_0.w_0"); - auto tensor_y = y_feed_value->GetMutable(); - tensor_y->ShareDataWith(t2); - - Variable *con_output = scope->Var("fc_0.tmp_0"); - auto *output_tensor = con_output->GetMutable(); - output_tensor->mutable_data({3, 3}); - // DLOG << typeid(output_tensor).name(); - // DLOG << "output_tensor dims: " << output_tensor->dims(); - - std::shared_ptr out_tensor = std::make_shared(); - out_tensor.reset(output_tensor); - - predict_mul(t1, t2, 0); - return out_tensor; - } - - private: - const framework::Program program_; - std::shared_ptr to_predict_program_; - std::map>>> - ops_of_block_; - bool use_optimize_ = false; - - void predict_mul(const Tensor &t1, const Tensor &t2, int block_id) { - std::shared_ptr to_predict_block = - to_predict_program_->Block(block_id); - for (int j = 0; j < ops_of_block_[*to_predict_block.get()].size(); - ++j) { - auto op = ops_of_block_[*to_predict_block.get()][j]; - DLOG << "op -> run()"; - op->Run(); + const std::vector> blocks = + to_predict_program_->Blocks(); + // DLOG << " **block size " << blocks.size(); + for (int i = 0; i < blocks.size(); ++i) { + std::shared_ptr block_desc = blocks[i]; + std::vector> ops = block_desc->Ops(); + // DLOG << " ops " << ops.size(); + for (int j = 0; j < ops.size(); ++j) { + std::shared_ptr op = ops[j]; + if (op->Type() == "mul" && op->Input("X")[0] == "pool2d_0.tmp_0") { + DLOG << " mul attr size: " << op->GetAttrMap().size(); + DLOG << " inputs size: " << op->GetInputs().size(); + DLOG << " outputs size: " << op->GetOutputs().size(); + DLOG << " Input X is : " << op->Input("X")[0]; + DLOG << " Input Y is : " << op->Input("Y")[0]; + DLOG << " Output Out is : " << op->Output("Out")[0]; + DLOG << "x_num_col_dims : " + << op->GetAttrMap().at("x_num_col_dims").Get(); + DLOG << "y_num_col_dims : " + << op->GetAttrMap().at("y_num_col_dims").Get(); + + std::shared_ptr> mul = + std::make_shared>( + op->Type(), op->GetInputs(), op->GetOutputs(), + op->GetAttrMap(), program_.scope); + ops_of_block_[*block_desc.get()].push_back(mul); } + } + } + } + + std::shared_ptr predict_mul(Tensor &t1, Tensor &t2) { + // feed + auto scope = program_.scope; + Variable *x_feed_value = scope->Var("pool2d_0.tmp_0"); + auto tensor_x = x_feed_value->GetMutable(); + tensor_x->ShareDataWith(t1); + + Variable *y_feed_value = scope->Var("fc_0.w_0"); + auto tensor_y = y_feed_value->GetMutable(); + tensor_y->ShareDataWith(t2); + + Variable *con_output = scope->Var("fc_0.tmp_0"); + auto *output_tensor = con_output->GetMutable(); + output_tensor->mutable_data({3, 3}); + // DLOG << typeid(output_tensor).name(); + // DLOG << "output_tensor dims: " << output_tensor->dims(); + + std::shared_ptr out_tensor = std::make_shared(); + out_tensor.reset(output_tensor); + + predict_mul(t1, t2, 0); + return out_tensor; + } + +private: + const framework::Program program_; + std::shared_ptr to_predict_program_; + std::map>>> + ops_of_block_; + bool use_optimize_ = false; + + void predict_mul(const Tensor &t1, const Tensor &t2, int block_id) { + std::shared_ptr to_predict_block = + to_predict_program_->Block(block_id); + for (int j = 0; j < ops_of_block_[*to_predict_block.get()].size(); ++j) { + auto op = ops_of_block_[*to_predict_block.get()][j]; + DLOG << "op -> run()"; + op->Run(); } + } }; template class TestMulOp; @@ -113,62 +111,62 @@ template class TestMulOp; } // namespace paddle_mobile int main() { - DLOG << "----------**********----------"; - DLOG << "begin to run MulOp Test"; - paddle_mobile::Loader loader; - auto program = - loader.Load(std::string("../../test/models/" - "image_classification_resnet.inference.model")); - - /// input x (3,2,1,1) - paddle_mobile::framework::Tensor inputx; - SetupTensor(&inputx, {3, 2, 1, 1}, static_cast(0), - static_cast(1)); - auto *inputx_ptr = inputx.data(); - - /// input y (2,3) - paddle_mobile::framework::Tensor inputy; - SetupTensor(&inputy, {2, 3}, static_cast(0), - static_cast(1)); - auto *inputy_ptr = inputy.data(); - - paddle_mobile::framework::TestMulOp testMulOp(program); - - auto output_mul = testMulOp.predict_mul(inputx, inputy); - auto *output_mul_ptr = output_mul->data(); - - auto dimx_1 = inputx.numel() / inputx.dims()[0]; - DLOG << " inputx : "; - for (int i = 0; i < inputx.dims()[0]; ++i) { - for (int j = 0; j < dimx_1; ++j) { - DLOGF("%f ", inputx_ptr[i * dimx_1 + j]); - } - DLOGF("\n"); + DLOG << "----------**********----------"; + DLOG << "begin to run MulOp Test"; + paddle_mobile::Loader loader; + auto program = + loader.Load(std::string("../../test/models/" + "image_classification_resnet.inference.model")); + + /// input x (3,2,1,1) + paddle_mobile::framework::Tensor inputx; + SetupTensor(&inputx, {3, 2, 1, 1}, static_cast(0), + static_cast(1)); + auto *inputx_ptr = inputx.data(); + + /// input y (2,3) + paddle_mobile::framework::Tensor inputy; + SetupTensor(&inputy, {2, 3}, static_cast(0), + static_cast(1)); + auto *inputy_ptr = inputy.data(); + + paddle_mobile::framework::TestMulOp testMulOp(program); + + auto output_mul = testMulOp.predict_mul(inputx, inputy); + auto *output_mul_ptr = output_mul->data(); + + auto dimx_1 = inputx.numel() / inputx.dims()[0]; + DLOG << " inputx : "; + for (int i = 0; i < inputx.dims()[0]; ++i) { + for (int j = 0; j < dimx_1; ++j) { + DLOGF("%f ", inputx_ptr[i * dimx_1 + j]); } - - auto dimy_1 = inputy.numel() / inputy.dims()[0]; - DLOG << " inputy : "; - for (int i = 0; i < inputy.dims()[0]; ++i) { - for (int j = 0; j < dimy_1; ++j) { - DLOGF("%f ", inputy_ptr[i * dimx_1 + j]); - } - DLOGF("\n"); + DLOGF("\n"); + } + + auto dimy_1 = inputy.numel() / inputy.dims()[0]; + DLOG << " inputy : "; + for (int i = 0; i < inputy.dims()[0]; ++i) { + for (int j = 0; j < dimy_1; ++j) { + DLOGF("%f ", inputy_ptr[i * dimx_1 + j]); } - - auto dim_output_1 = output_mul->numel() / output_mul->dims()[0]; - DLOG << " output : "; - for (int i = 0; i < output_mul->dims()[0]; ++i) { - for (int j = 0; j < dim_output_1; ++j) { - DLOGF("%f ", output_mul_ptr[i * dimy_1 + j]); - } - DLOGF("\n"); + DLOGF("\n"); + } + + auto dim_output_1 = output_mul->numel() / output_mul->dims()[0]; + DLOG << " output : "; + for (int i = 0; i < output_mul->dims()[0]; ++i) { + for (int j = 0; j < dim_output_1; ++j) { + DLOGF("%f ", output_mul_ptr[i * dimy_1 + j]); } + DLOGF("\n"); + } - /// output (3,3) - DLOG << "output memory size : " << output_mul->memory_size(); - DLOG << "output numel : " << output_mul->numel(); + /// output (3,3) + DLOG << "output memory size : " << output_mul->memory_size(); + DLOG << "output numel : " << output_mul->numel(); - DLOG << inputx_ptr[0] << " x " << inputy_ptr[0] << " + " << inputx_ptr[1] - << " x " << inputy_ptr[0 + 3] << " = " << output_mul_ptr[0]; - return 0; + DLOG << inputx_ptr[0] << " x " << inputy_ptr[0] << " + " << inputx_ptr[1] + << " x " << inputy_ptr[0 + 3] << " = " << output_mul_ptr[0]; + return 0; } diff --git a/test/operators/test_pool_op.cpp b/test/operators/test_pool_op.cpp index 44be2fb5bc1f9d98c0731dc507ea961191165e44..6d5be4c38d957abc652b8c72bd6895616b687c6a 100644 --- a/test/operators/test_pool_op.cpp +++ b/test/operators/test_pool_op.cpp @@ -21,26 +21,26 @@ SOFTWARE. #include "io.h" int main() { - paddle_mobile::Loader loader; - auto program = loader.Load(std::string("../models/googlenet")); - if (program.originProgram == nullptr) { - DLOG << "program read file"; - } + paddle_mobile::Loader loader; + auto program = loader.Load(std::string("../models/googlenet")); + if (program.originProgram == nullptr) { + DLOG << "program read file"; + } - Executor4Test> - executor(program, "pool2d"); + Executor4Test> + executor(program, "pool2d"); - paddle_mobile::framework::Tensor input; - SetupTensor(&input, {1, 64, 112, 112}, static_cast(0), - static_cast(1)); + paddle_mobile::framework::Tensor input; + SetupTensor(&input, {1, 64, 112, 112}, static_cast(0), + static_cast(1)); - auto output = executor.predict(input, "conv2d_0.tmp_1", "pool2d_0.tmp_0", - {1, 64, 56, 56}); + auto output = executor.predict(input, "conv2d_0.tmp_1", "pool2d_0.tmp_0", + {1, 64, 56, 56}); - float *output_ptr = output->data(); - for (int j = 0; j < output->numel(); ++j) { - DLOG << " value of output: " << output_ptr[j]; - } - return 0; + float *output_ptr = output->data(); + for (int j = 0; j < output->numel(); ++j) { + DLOG << " value of output: " << output_ptr[j]; + } + return 0; } diff --git a/test/test_helper.h b/test/test_helper.h index ffb9131be703f0a5eef8a6d58e87ad17c4c103e6..d73f0284f7606eda22568c35303b4c8796fa370e 100644 --- a/test/test_helper.h +++ b/test/test_helper.h @@ -24,13 +24,12 @@ SOFTWARE. template void SetupTensor(paddle_mobile::framework::Tensor *input, paddle_mobile::framework::DDim dims, T lower, T upper) { - static unsigned int seed = 100; - std::mt19937 rng(seed++); - std::uniform_real_distribution uniform_dist(0, 1); + static unsigned int seed = 100; + std::mt19937 rng(seed++); + std::uniform_real_distribution uniform_dist(0, 1); - T *input_ptr = input->mutable_data(dims); - for (int i = 0; i < input->numel(); ++i) { - input_ptr[i] = - static_cast(uniform_dist(rng) * (upper - lower) + lower); - } + T *input_ptr = input->mutable_data(dims); + for (int i = 0; i < input->numel(); ++i) { + input_ptr[i] = static_cast(uniform_dist(rng) * (upper - lower) + lower); + } } diff --git a/tools/pre-commit.hooks/.clang-tidy.hook b/tools/pre-commit.hooks/.clang-tidy.hook index 367462daaf4de375b4e7e71799efe0ed09d2d3f8..3b0445e20f333712647f62495a623fcd4d60615d 100755 --- a/tools/pre-commit.hooks/.clang-tidy.hook +++ b/tools/pre-commit.hooks/.clang-tidy.hook @@ -6,8 +6,7 @@ TOTAL_ERRORS=0 # The trick to remove deleted files: https://stackoverflow.com/a/2413151 for file in $(git diff --cached --name-status | awk '$1 != "D" {print $2}' | grep -v "third-party/" | grep -v ".pb."); do - python ./tools/pre-commit.hooks/run-clang-tidy.py $file; - echo "python ./tools/pre-commit.hooks/run-clang-tidy.py $file" + bash -c "python ./tools/pre-commit.hooks/run-clang-tidy.py $file -fix"; TOTAL_ERRORS=$(expr $TOTAL_ERRORS + $?); done