From 017f5ed45f2492bdbcab02be54df367ae0379d67 Mon Sep 17 00:00:00 2001 From: willzhang4a58 Date: Wed, 15 Feb 2017 02:59:02 -0500 Subject: [PATCH] proto 2to3 --- .gitignore | 1 + oneflow/job/dlnet_conf.proto | 4 ++-- oneflow/job/job_conf.proto | 16 ++++++++-------- oneflow/job/resource.proto | 6 +++--- oneflow/job/strategy.proto | 12 ++++++------ oneflow/layer/layer_conf.proto | 20 ++++++++++---------- 6 files changed, 30 insertions(+), 29 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..378eac25d3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build diff --git a/oneflow/job/dlnet_conf.proto b/oneflow/job/dlnet_conf.proto index 5bf984bb55..42a5e9a943 100644 --- a/oneflow/job/dlnet_conf.proto +++ b/oneflow/job/dlnet_conf.proto @@ -1,9 +1,9 @@ -syntax = "proto2"; +syntax = "proto3"; package oneflow; import "layer/layer_conf.proto"; message DLNetConf { - required string name = 1; + string name = 1; repeated LayerConf layer_conf = 100; } diff --git a/oneflow/job/job_conf.proto b/oneflow/job/job_conf.proto index 1677fce0ec..22af79a7f6 100644 --- a/oneflow/job/job_conf.proto +++ b/oneflow/job/job_conf.proto @@ -1,4 +1,4 @@ -syntax = "proto2"; +syntax = "proto3"; package oneflow; import "job/dlnet_conf.proto"; @@ -6,14 +6,14 @@ import "job/resource.proto"; import "job/strategy.proto"; message JobUserConf { - required string train_dlnet_conf_filepath = 1; - required string resource_filepath = 2; - required string strategy_filepath = 3; + string train_dlnet_conf_filepath = 1; + string resource_filepath = 2; + string strategy_filepath = 3; } message JobSysConf { - required JobUserConf user_conf = 1; - required DLNetConf train_dlnet_conf = 2; - required Resource resource = 3; - required Strategy strategy = 4; + JobUserConf user_conf = 1; + DLNetConf train_dlnet_conf = 2; + Resource resource = 3; + Strategy strategy = 4; } diff --git a/oneflow/job/resource.proto b/oneflow/job/resource.proto index a1b860d1a2..6af4b4e4aa 100644 --- a/oneflow/job/resource.proto +++ b/oneflow/job/resource.proto @@ -1,9 +1,9 @@ -syntax = "proto2"; +syntax = "proto3"; package oneflow; message Machine { - required string addr = 1; // domain name or ip - required string port = 2; + string addr = 1; // domain name or ip + string port = 2; repeated int32 device_vec = 3; } diff --git a/oneflow/job/strategy.proto b/oneflow/job/strategy.proto index 77668b2e22..e192f987e5 100644 --- a/oneflow/job/strategy.proto +++ b/oneflow/job/strategy.proto @@ -1,9 +1,9 @@ -syntax = "proto2"; +syntax = "proto3"; package oneflow; message Section { - required int32 first_id = 1; - required int32 last_id = 2; + int32 first_id = 1; + int32 last_id = 2; } message DeviceGroup { @@ -19,7 +19,7 @@ message ParallelConf { DataParallel = 0; ModelParallel = 1; } - required Policy policy = 1; + Policy policy = 1; oneof device_or_machine { DeviceGroup device_group = 2; MachineGroup machine_group = 3; @@ -27,9 +27,9 @@ message ParallelConf { } message PlacementGroup { - required string name = 1; + string name = 1; repeated string layer_name_vec = 2; - optional ParallelConf parallel_conf = 3; + ParallelConf parallel_conf = 3; } message Strategy { diff --git a/oneflow/layer/layer_conf.proto b/oneflow/layer/layer_conf.proto index f835cd0202..88c4ad87fd 100644 --- a/oneflow/layer/layer_conf.proto +++ b/oneflow/layer/layer_conf.proto @@ -1,21 +1,21 @@ -syntax = "proto2"; +syntax = "proto3"; package oneflow; message ConstantModelParamInitializerConf { - required float const_val = 1; + float const_val = 1; } message UniformModelParamInitializerConf { - required float min = 1; - required float max = 2; + float min = 1; + float max = 2; } message GaussianModelParamInitializerConf { - required float mean = 1; - required float std = 2; + float mean = 1; + float std = 2; // The expected number of non-zero output weights for a given input - // the default -1 means don't perform sparsification - optional int32 sparse = 3 [default = -1]; + // set -1 means don't perform sparsification + int32 sparse = 3; } message ModelParamInitializerConf { @@ -27,12 +27,12 @@ message ModelParamInitializerConf { } message SplitLayerConf { - required string in = 1; + string in = 1; repeated string out = 2; } message LayerConf { - required string name = 1; + string name = 1; oneof conf_for_specified_layer { // TODO: add other layers SplitLayerConf split_layer_conf = 101; -- GitLab