提交 087b477e 编写于 作者: 叶剑武

Merge branch 'benchmark-bug' into 'master'

Remove unsed definition in api of mace.h

See merge request !571
......@@ -15,7 +15,6 @@ cc_library(
hdrs = ["statistics.h"],
copts = ["-Werror", "-Wextra", "-Wno-missing-field-initializers"],
deps = [
"//mace/kernels",
"//mace/utils",
],
)
......
......@@ -16,7 +16,6 @@
#include <set>
#include "mace/kernels/conv_pool_2d_util.h"
#include "mace/utils/logging.h"
#include "mace/utils/string_util.h"
......@@ -39,18 +38,18 @@ std::string MetricToString(const Metric metric) {
std::string PaddingTypeToString(int padding_type) {
std::stringstream stream;
Padding type = static_cast<Padding>(padding_type);
switch (type) {
case VALID: stream << "VALID"; break;
case SAME: stream << "SAME"; break;
case FULL: stream << "FULL"; break;
switch (padding_type) {
case 0: stream << "VALID"; break;
case 1: stream << "SAME"; break;
case 2: stream << "FULL"; break;
default: stream << padding_type; break;
}
return stream.str();
}
std::string ShapeToString(const std::vector<OutputShape> &output_shape) {
std::string ShapeToString(
const std::vector<std::vector<int64_t>> &output_shape) {
if (output_shape.empty()) {
return "";
}
......@@ -58,9 +57,9 @@ std::string ShapeToString(const std::vector<OutputShape> &output_shape) {
std::stringstream stream;
stream << "[";
for (size_t i = 0; i < output_shape.size(); ++i) {
size_t dims_size = output_shape[i].dims_size();
size_t dims_size = output_shape[i].size();
for (size_t j = 0; j < dims_size; ++j) {
stream << output_shape[i].dims(j);
stream << output_shape[i][j];
if (j != dims_size - 1) {
stream << ",";
}
......@@ -176,7 +175,7 @@ std::string OpStat::StatByMetric(const Metric metric,
} else {
tuple.push_back(VectorToString<int>(record.args.paddings));
}
tuple.push_back(VectorToString<index_t>(record.args.kernels));
tuple.push_back(VectorToString<int64_t>(record.args.kernels));
tuple.push_back(ShapeToString(record.output_shape));
tuple.push_back(VectorToString<int>(record.args.dilations));
tuple.push_back(record.name);
......
......@@ -23,7 +23,7 @@
#include <string>
#include <vector>
#include "mace/kernels/conv_pool_2d_util.h"
#include "mace/public/mace.h"
#include "mace/utils/string_util.h"
namespace mace {
......@@ -142,7 +142,7 @@ class OpStat{
struct Record{
std::string name;
std::string type;
std::vector<OutputShape> output_shape;
std::vector<std::vector<int64_t>> output_shape;
ConvPoolArgs args;
int64_t order;
TimeInfo<int64_t> start;
......
......@@ -108,9 +108,13 @@ MaceStatus SerialNet::Run(RunMetadata *run_metadata) {
}
}
std::vector<std::vector<int64_t>> output_shapes;
for (auto output_shape : op->debug_def().output_shape()) {
output_shapes.push_back({output_shape.dims().begin(),
output_shape.dims().end()});
}
OperatorStats op_stats = {op->debug_def().name(), op->debug_def().type(),
{op->debug_def().output_shape().begin(),
op->debug_def().output_shape().end()},
output_shapes,
{strides, padding_type, paddings, dilations,
kernels}, call_stats};
run_metadata->op_stats.emplace_back(op_stats);
......
......@@ -26,7 +26,6 @@
namespace mace {
class OutputShape;
class NetDef;
enum DeviceType { CPU = 0, GPU = 2, HEXAGON = 3 };
......@@ -47,7 +46,7 @@ struct ConvPoolArgs {
struct OperatorStats {
std::string operator_name;
std::string type;
std::vector<OutputShape> output_shape;
std::vector<std::vector<int64_t>> output_shape;
ConvPoolArgs args;
CallStats stats;
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册