提交 9fd937cd 编写于 作者: 李寅

Merge branch 'remove_name_and_version_in_NetDef_pb' into 'master'

remove name and version in NetDef in mace.proto

See merge request !828
......@@ -29,7 +29,8 @@ NetBase::NetBase(const std::shared_ptr<const OperatorRegistryBase> op_registry,
const std::shared_ptr<const NetDef> 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);
......
......@@ -42,10 +42,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<const OperatorRegistryBase> op_registry_;
MACE_DISABLE_COPY_AND_ASSIGN(NetBase);
......
......@@ -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;
......
......@@ -146,8 +146,6 @@ const std::shared_ptr<NetDef> CreateNet() {
MACE_LATENCY_LOGGER(1, "Create net {{ net.name }}");
std::shared_ptr<NetDef> net_def(new NetDef());
net_def->set_name("{{ net.name}}");
net_def->set_version("{{ net.version }}");
CreateOperators(net_def.get());
CreateTensors(net_def.get());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册