From 4a9ea4a32da247515eeea46f2f4ec7c11adc821f Mon Sep 17 00:00:00 2001 From: liuqi Date: Sun, 17 Dec 2017 18:37:55 +0800 Subject: [PATCH] Rename proto_utils to arg_helper. --- mace/core/{proto_utils.cc => arg_helper.cc} | 2 +- mace/core/{proto_utils.h => arg_helper.h} | 6 +++--- mace/core/operator.h | 2 +- mace/core/workspace.cc | 4 ++-- mace/proto/BUILD | 10 ---------- 5 files changed, 7 insertions(+), 17 deletions(-) rename mace/core/{proto_utils.cc => arg_helper.cc} (99%) rename mace/core/{proto_utils.h => arg_helper.h} (95%) diff --git a/mace/core/proto_utils.cc b/mace/core/arg_helper.cc similarity index 99% rename from mace/core/proto_utils.cc rename to mace/core/arg_helper.cc index 064f5b28..d2230c44 100644 --- a/mace/core/proto_utils.cc +++ b/mace/core/arg_helper.cc @@ -2,7 +2,7 @@ // Copyright (c) 2017 XiaoMi All rights reserved. // -#include "mace/core/proto_utils.h" +#include "mace/core/arg_helper.h" namespace mace { diff --git a/mace/core/proto_utils.h b/mace/core/arg_helper.h similarity index 95% rename from mace/core/proto_utils.h rename to mace/core/arg_helper.h index 6ccf98a4..a7c66173 100644 --- a/mace/core/proto_utils.h +++ b/mace/core/arg_helper.h @@ -2,8 +2,8 @@ // Copyright (c) 2017 XiaoMi All rights reserved. // -#ifndef MACE_CORE_PROTO_UTILS_H_ -#define MACE_CORE_PROTO_UTILS_H_ +#ifndef MACE_CORE_ARG_HELPER_H_ +#define MACE_CORE_ARG_HELPER_H_ #include @@ -68,4 +68,4 @@ class ArgumentHelper { } // namespace mace -#endif // MACE_CORE_PROTO_UTILS_H_ +#endif // MACE_CORE_ARG_HELPER_H_ diff --git a/mace/core/operator.h b/mace/core/operator.h index e5fc44f0..ef0cd7bd 100644 --- a/mace/core/operator.h +++ b/mace/core/operator.h @@ -6,7 +6,7 @@ #define MACE_CORE_OPERATOR_H #include "mace/core/common.h" -#include "mace/core/proto_utils.h" +#include "mace/core/arg_helper.h" #include "mace/core/registry.h" #include "mace/core/tensor.h" #include "mace/core/workspace.h" diff --git a/mace/core/workspace.cc b/mace/core/workspace.cc index cc575ddd..b21fcf6d 100644 --- a/mace/core/workspace.cc +++ b/mace/core/workspace.cc @@ -4,7 +4,7 @@ #include "mace/core/workspace.h" #include "mace/core/serializer.h" -#include "mace/core/proto_utils.h" +#include "mace/core/arg_helper.h" namespace mace { @@ -69,7 +69,7 @@ void Workspace::LoadModelTensor(const NetDef &net_def, DeviceType type) { } void Workspace::CreateImageOutputTensor(const NetDef &net_def) { - if (net_def.has_mem_arena() || net_def.mem_arena().mem_block_size() == 0) { + if (!net_def.has_mem_arena() || net_def.mem_arena().mem_block_size() == 0) { return; } std::map> mem_tensor_map; diff --git a/mace/proto/BUILD b/mace/proto/BUILD index 593fdea5..e166ade2 100644 --- a/mace/proto/BUILD +++ b/mace/proto/BUILD @@ -10,16 +10,6 @@ licenses(["notice"]) # Apache 2.0 load("@com_google_protobuf//:protobuf.bzl", "py_proto_library") -proto_library( - name = "proto", - srcs = ["mace.proto"], -) - -cc_proto_library( - name = "cc_proto", - deps = [":proto"], -) - proto_library( name = "stats", srcs = ["stats.proto"], -- GitLab