diff --git a/mace/core/net.cc b/mace/core/net.cc index e6c20cda1217f060985e59b3f3eb7f02559d5774..d914226e8b906db39c1437b9f2c751eccfc0f460 100644 --- a/mace/core/net.cc +++ b/mace/core/net.cc @@ -23,7 +23,9 @@ SimpleNet::SimpleNet(const std::shared_ptr& net_def, std::unique_ptr op{nullptr}; OperatorDef temp_def(operator_def); op = CreateOperator(temp_def, ws, type); - operators_.emplace_back(std::move(op)); + if (!op) { + operators_.emplace_back(std::move(op)); + } } } bool SimpleNet::Run() { diff --git a/mace/core/registry.h b/mace/core/registry.h index 08ea209d0160f96c34e558fa5a205c32555a17e3..1295128cf1446fc53a996ed1a0910eea3ccb3df1 100644 --- a/mace/core/registry.h +++ b/mace/core/registry.h @@ -26,8 +26,7 @@ class Registry { unique_ptr Create(const SrcType& key, Args... args) { if (registry_.count(key) == 0) { - VLOG(2) << "Key not registered: " << key; - return nullptr; + LOG(FATAL) << "Key not registered: " << key; } return registry_[key](args...); } diff --git a/mace/ops/depthwise_conv_2d_benchmark.cc b/mace/ops/depthwise_conv_2d_benchmark.cc index 5442444ec19f0825bb84d599a4b167eadbbe3d2e..f535ea17273d028d01c4e56e8f7f32275c73eb33 100644 --- a/mace/ops/depthwise_conv_2d_benchmark.cc +++ b/mace/ops/depthwise_conv_2d_benchmark.cc @@ -25,7 +25,7 @@ static void DepthwiseConv2d(int iters, mace::testing::StopTiming(); OpsTestNet net; - OpDefBuilder("DepthwiseConv2D", "DepthwiseConv2DTest") + OpDefBuilder("DepthwiseConv2d", "DepthwiseConv2dTest") .Input("Input") .Input("Filter") .Input("Bias")