From 8f851c1534b234e17892ce06c40129ddb63db28d Mon Sep 17 00:00:00 2001 From: yejianwu Date: Fri, 12 Oct 2018 15:59:45 +0800 Subject: [PATCH] remove name and version in NetDef in mace.proto --- mace/core/net.cc | 5 +++-- mace/core/net.h | 3 --- mace/proto/mace.proto | 8 +++----- mace/python/tools/model.jinja2 | 2 -- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/mace/core/net.cc b/mace/core/net.cc index faa4e1d3..f38c6116 100644 --- a/mace/core/net.cc +++ b/mace/core/net.cc @@ -29,7 +29,8 @@ NetBase::NetBase(const std::shared_ptr op_registry, const std::shared_ptr net_def, Workspace *ws, Device *device) - : name_(net_def->name()), op_registry_(op_registry) { + : op_registry_(op_registry) { + MACE_UNUSED(net_def); MACE_UNUSED(ws); MACE_UNUSED(device); } @@ -42,7 +43,7 @@ SerialNet::SerialNet( const NetMode mode) : NetBase(op_registry, net_def, ws, device), device_(device), op_kernel_context_(new OpKernelContext(ws, device)) { - MACE_LATENCY_LOGGER(1, "Constructing SerialNet ", net_def->name()); + MACE_LATENCY_LOGGER(1, "Constructing SerialNet"); DeviceType device_type = device->device_type(); for (int idx = 0; idx < net_def->op_size(); ++idx) { const auto &operator_def = net_def->op(idx); diff --git a/mace/core/net.h b/mace/core/net.h index a63ded66..7f8094fc 100644 --- a/mace/core/net.h +++ b/mace/core/net.h @@ -37,10 +37,7 @@ class NetBase { virtual MaceStatus Run(RunMetadata *run_metadata = nullptr) = 0; - const std::string &Name() const { return name_; } - protected: - std::string name_; const std::shared_ptr op_registry_; MACE_DISABLE_COPY_AND_ASSIGN(NetBase); diff --git a/mace/proto/mace.proto b/mace/proto/mace.proto index 0bf4c7da..11f2a88d 100644 --- a/mace/proto/mace.proto +++ b/mace/proto/mace.proto @@ -116,11 +116,9 @@ message OutputInfo { } message NetDef { - optional string name = 1; - repeated OperatorDef op = 2; - optional string version = 3; - repeated Argument arg = 4; - repeated ConstTensor tensors = 5; + repeated OperatorDef op = 1; + repeated Argument arg = 2; + repeated ConstTensor tensors = 3; // for mem optimization optional MemoryArena mem_arena = 10; diff --git a/mace/python/tools/model.jinja2 b/mace/python/tools/model.jinja2 index 9e8c521b..3f4ba1c4 100644 --- a/mace/python/tools/model.jinja2 +++ b/mace/python/tools/model.jinja2 @@ -146,8 +146,6 @@ const std::shared_ptr CreateNet() { MACE_LATENCY_LOGGER(1, "Create net {{ net.name }}"); std::shared_ptr net_def(new NetDef()); - net_def->set_name("{{ net.name}}"); - net_def->set_version("{{ net.version }}"); CreateOperators(net_def.get()); CreateTensors(net_def.get()); -- GitLab