summaryrefslogtreecommitdiff
path: root/compiler/moco/import/src
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/moco/import/src')
-rw-r--r--compiler/moco/import/src/GraphBuilderRegistry.cpp66
-rw-r--r--compiler/moco/import/src/Importer.cpp10
-rw-r--r--compiler/moco/import/src/Nodes/Add.cpp5
-rw-r--r--compiler/moco/import/src/Nodes/AvgPool.cpp6
-rw-r--r--compiler/moco/import/src/Nodes/BiasAdd.cpp6
-rw-r--r--compiler/moco/import/src/Nodes/Concat.cpp6
-rw-r--r--compiler/moco/import/src/Nodes/Const.cpp2
-rw-r--r--compiler/moco/import/src/Nodes/Conv2D.cpp4
-rw-r--r--compiler/moco/import/src/Nodes/Conv2DBackpropInput.cpp7
-rw-r--r--compiler/moco/import/src/Nodes/DepthwiseConv2dNative.cpp8
-rw-r--r--compiler/moco/import/src/Nodes/FakeQuantWithMinMaxVars.cpp6
-rw-r--r--compiler/moco/import/src/Nodes/FusedBatchNorm.cpp7
-rw-r--r--compiler/moco/import/src/Nodes/Identity.cpp6
-rw-r--r--compiler/moco/import/src/Nodes/MaxPool.cpp6
-rw-r--r--compiler/moco/import/src/Nodes/Maximum.cpp5
-rw-r--r--compiler/moco/import/src/Nodes/Mean.cpp9
-rw-r--r--compiler/moco/import/src/Nodes/Mul.cpp5
-rw-r--r--compiler/moco/import/src/Nodes/Pack.cpp4
-rw-r--r--compiler/moco/import/src/Nodes/Pad.cpp5
-rw-r--r--compiler/moco/import/src/Nodes/RealDiv.cpp5
-rw-r--r--compiler/moco/import/src/Nodes/Relu.cpp4
-rw-r--r--compiler/moco/import/src/Nodes/Relu6.cpp4
-rw-r--r--compiler/moco/import/src/Nodes/Reshape.cpp4
-rw-r--r--compiler/moco/import/src/Nodes/Rsqrt.cpp6
-rw-r--r--compiler/moco/import/src/Nodes/Shape.cpp7
-rw-r--r--compiler/moco/import/src/Nodes/Softmax.cpp11
-rw-r--r--compiler/moco/import/src/Nodes/Sqrt.cpp5
-rw-r--r--compiler/moco/import/src/Nodes/SquaredDifference.cpp7
-rw-r--r--compiler/moco/import/src/Nodes/Squeeze.cpp7
-rw-r--r--compiler/moco/import/src/Nodes/StopGradient.cpp5
-rw-r--r--compiler/moco/import/src/Nodes/StridedSlice.cpp7
-rw-r--r--compiler/moco/import/src/Nodes/Sub.cpp5
-rw-r--r--compiler/moco/import/src/Nodes/Tanh.cpp5
-rw-r--r--compiler/moco/import/src/TestHelper.test.cpp9
34 files changed, 141 insertions, 123 deletions
diff --git a/compiler/moco/import/src/GraphBuilderRegistry.cpp b/compiler/moco/import/src/GraphBuilderRegistry.cpp
index 3a028513f..7e91ca9d0 100644
--- a/compiler/moco/import/src/GraphBuilderRegistry.cpp
+++ b/compiler/moco/import/src/GraphBuilderRegistry.cpp
@@ -17,45 +17,45 @@
#include "moco/Import/GraphBuilderRegistry.h"
#include "moco/Import/Nodes.h"
-#include <stdex/Memory.h>
+#include <memory>
namespace moco
{
GraphBuilderRegistry::GraphBuilderRegistry()
{
- add("Add", stdex::make_unique<AddGraphBuilder>());
- add("AvgPool", stdex::make_unique<AvgPoolGraphBuilder>());
- add("BiasAdd", stdex::make_unique<BiasAddGraphBuilder>());
- add("ConcatV2", stdex::make_unique<ConcatV2GraphBuilder>());
- add("Const", stdex::make_unique<ConstGraphBuilder>());
- add("Conv2D", stdex::make_unique<Conv2DGraphBuilder>());
- add("Conv2DBackpropInput", stdex::make_unique<Conv2DBackpropInputGraphBuilder>());
- add("DepthwiseConv2dNative", stdex::make_unique<DepthwiseConv2dNativeGraphBuilder>());
- add("FakeQuantWithMinMaxVars", stdex::make_unique<FakeQuantWithMinMaxVarsGraphBuilder>());
- add("FusedBatchNorm", stdex::make_unique<FusedBatchNormGraphBuilder>());
- add("Identity", stdex::make_unique<IdentityGraphBuilder>());
- add("Maximum", stdex::make_unique<MaximumGraphBuilder>());
- add("MaxPool", stdex::make_unique<MaxPoolGraphBuilder>());
- add("Mean", stdex::make_unique<MeanGraphBuilder>());
- add("Mul", stdex::make_unique<MulGraphBuilder>());
- add("Pack", stdex::make_unique<PackGraphBuilder>());
- add("Pad", stdex::make_unique<PadGraphBuilder>());
- add("Placeholder", stdex::make_unique<PlaceholderGraphBuilder>());
- add("RealDiv", stdex::make_unique<RealDivGraphBuilder>());
- add("Relu", stdex::make_unique<ReluGraphBuilder>());
- add("Relu6", stdex::make_unique<Relu6GraphBuilder>());
- add("Reshape", stdex::make_unique<ReshapeGraphBuilder>());
- add("Rsqrt", stdex::make_unique<RsqrtGraphBuilder>());
- add("Shape", stdex::make_unique<ShapeGraphBuilder>());
- add("Softmax", stdex::make_unique<SoftmaxGraphBuilder>());
- add("Sqrt", stdex::make_unique<SqrtGraphBuilder>());
- add("SquaredDifference", stdex::make_unique<SquaredDifferenceGraphBuilder>());
- add("Squeeze", stdex::make_unique<SqueezeGraphBuilder>());
- add("StopGradient", stdex::make_unique<StopGradientGraphBuilder>());
- add("StridedSlice", stdex::make_unique<StridedSliceGraphBuilder>());
- add("Sub", stdex::make_unique<SubGraphBuilder>());
- add("Tanh", stdex::make_unique<TanhGraphBuilder>());
+ add("Add", std::make_unique<AddGraphBuilder>());
+ add("AvgPool", std::make_unique<AvgPoolGraphBuilder>());
+ add("BiasAdd", std::make_unique<BiasAddGraphBuilder>());
+ add("ConcatV2", std::make_unique<ConcatV2GraphBuilder>());
+ add("Const", std::make_unique<ConstGraphBuilder>());
+ add("Conv2D", std::make_unique<Conv2DGraphBuilder>());
+ add("Conv2DBackpropInput", std::make_unique<Conv2DBackpropInputGraphBuilder>());
+ add("DepthwiseConv2dNative", std::make_unique<DepthwiseConv2dNativeGraphBuilder>());
+ add("FakeQuantWithMinMaxVars", std::make_unique<FakeQuantWithMinMaxVarsGraphBuilder>());
+ add("FusedBatchNorm", std::make_unique<FusedBatchNormGraphBuilder>());
+ add("Identity", std::make_unique<IdentityGraphBuilder>());
+ add("Maximum", std::make_unique<MaximumGraphBuilder>());
+ add("MaxPool", std::make_unique<MaxPoolGraphBuilder>());
+ add("Mean", std::make_unique<MeanGraphBuilder>());
+ add("Mul", std::make_unique<MulGraphBuilder>());
+ add("Pack", std::make_unique<PackGraphBuilder>());
+ add("Pad", std::make_unique<PadGraphBuilder>());
+ add("Placeholder", std::make_unique<PlaceholderGraphBuilder>());
+ add("RealDiv", std::make_unique<RealDivGraphBuilder>());
+ add("Relu", std::make_unique<ReluGraphBuilder>());
+ add("Relu6", std::make_unique<Relu6GraphBuilder>());
+ add("Reshape", std::make_unique<ReshapeGraphBuilder>());
+ add("Rsqrt", std::make_unique<RsqrtGraphBuilder>());
+ add("Shape", std::make_unique<ShapeGraphBuilder>());
+ add("Softmax", std::make_unique<SoftmaxGraphBuilder>());
+ add("Sqrt", std::make_unique<SqrtGraphBuilder>());
+ add("SquaredDifference", std::make_unique<SquaredDifferenceGraphBuilder>());
+ add("Squeeze", std::make_unique<SqueezeGraphBuilder>());
+ add("StopGradient", std::make_unique<StopGradientGraphBuilder>());
+ add("StridedSlice", std::make_unique<StridedSliceGraphBuilder>());
+ add("Sub", std::make_unique<SubGraphBuilder>());
+ add("Tanh", std::make_unique<TanhGraphBuilder>());
// Virtual node like `TFPush` need not to be added here
}
diff --git a/compiler/moco/import/src/Importer.cpp b/compiler/moco/import/src/Importer.cpp
index 3813affce..0659fd165 100644
--- a/compiler/moco/import/src/Importer.cpp
+++ b/compiler/moco/import/src/Importer.cpp
@@ -23,9 +23,9 @@
#include <moco/IR/Nodes/TFPlaceholder.h>
#include <moco/IR/TFNode.h>
-#include <stdex/Memory.h>
#include <oops/UserExn.h>
+#include <memory>
#include <cassert>
#include <sstream>
#include <stdexcept>
@@ -36,9 +36,9 @@ namespace
void convert_graph(const moco::GraphBuilderSource &source, const moco::ModelSignature &signature,
tensorflow::GraphDef &tf_graph_def, loco::Graph *graph)
{
- auto nodedef = stdex::make_unique<moco::NodeDefTable>();
- auto tensor_names = stdex::make_unique<moco::SymbolTable>();
- auto updates = stdex::make_unique<moco::UpdateQueue>();
+ auto nodedef = std::make_unique<moco::NodeDefTable>();
+ auto tensor_names = std::make_unique<moco::SymbolTable>();
+ auto updates = std::make_unique<moco::UpdateQueue>();
moco::GraphBuilderContext gb_context(graph, nodedef.get(), tensor_names.get(), updates.get());
@@ -190,7 +190,7 @@ std::unique_ptr<loco::Graph> Importer::import(const ModelSignature &signature,
convert_graph(*source_ptr, signature, tf_graph_def, graph.get());
- return std::move(graph);
+ return graph;
}
} // namespace moco
diff --git a/compiler/moco/import/src/Nodes/Add.cpp b/compiler/moco/import/src/Nodes/Add.cpp
index 6981a55e1..af743316b 100644
--- a/compiler/moco/import/src/Nodes/Add.cpp
+++ b/compiler/moco/import/src/Nodes/Add.cpp
@@ -19,7 +19,8 @@
#include <moco/IR/Nodes/TFAdd.h>
#include <loco.h>
-#include <stdex/Memory.h>
+
+#include <memory>
namespace
{
@@ -78,7 +79,7 @@ void AddGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderContext
add_input_names.push_back(TensorName(node.input(0))); // x
add_input_names.push_back(TensorName(node.input(1))); // y
- auto tf_add_update = stdex::make_unique<TFAddGraphUpdate>(tf_add, add_input_names);
+ auto tf_add_update = std::make_unique<TFAddGraphUpdate>(tf_add, add_input_names);
updates->enroll(std::move(tf_add_update));
}
diff --git a/compiler/moco/import/src/Nodes/AvgPool.cpp b/compiler/moco/import/src/Nodes/AvgPool.cpp
index 6d7fd36bb..95232b977 100644
--- a/compiler/moco/import/src/Nodes/AvgPool.cpp
+++ b/compiler/moco/import/src/Nodes/AvgPool.cpp
@@ -22,10 +22,10 @@
#include "Convert.h"
#include <loco/IR/PermutingCodec.h>
-#include <stdex/Memory.h>
#include <plier/tf/Convert.h>
#include <oops/UserExn.h>
+#include <memory>
#include <cassert>
#include <stdexcept>
@@ -40,7 +40,7 @@ class TFAvgPoolGraphUpdate final : public GraphUpdate
{
public:
TFAvgPoolGraphUpdate(TFAvgPool *node, const TensorName &name)
- : _avgpool_node(node), _value_name(name)
+ : _avgpool_node(node), _value_name(name)
{
}
@@ -127,7 +127,7 @@ void AvgPoolGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderCon
tensor_names->enroll(output_name, avgPool_node);
// Record ifm inputs to featureEncode_node
- auto update = stdex::make_unique<TFAvgPoolGraphUpdate>(avgPool_node, TensorName(node.input(0)));
+ auto update = std::make_unique<TFAvgPoolGraphUpdate>(avgPool_node, TensorName(node.input(0)));
updates->enroll(std::move(update));
}
diff --git a/compiler/moco/import/src/Nodes/BiasAdd.cpp b/compiler/moco/import/src/Nodes/BiasAdd.cpp
index a3eb91116..d4bc161d5 100644
--- a/compiler/moco/import/src/Nodes/BiasAdd.cpp
+++ b/compiler/moco/import/src/Nodes/BiasAdd.cpp
@@ -22,10 +22,10 @@
#include <loco.h>
#include <loco/IR/PermutingCodec.h>
-#include <stdex/Memory.h>
#include <plier/tf/Convert.h>
#include <oops/UserExn.h>
+#include <memory>
#include <cassert>
#include <vector>
@@ -37,7 +37,7 @@ class TFBiasAddGraphUpdate final : public GraphUpdate
{
public:
TFBiasAddGraphUpdate(TFBiasAdd *biasadd, std::vector<TensorName> &names)
- : _biasadd(biasadd), _names(names)
+ : _biasadd(biasadd), _names(names)
{
}
@@ -115,7 +115,7 @@ void BiasAddGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderCon
input_names.push_back(TensorName(node.input(0)));
input_names.push_back(TensorName(node.input(1)));
- auto update = stdex::make_unique<TFBiasAddGraphUpdate>(tf_bias_add, input_names);
+ auto update = std::make_unique<TFBiasAddGraphUpdate>(tf_bias_add, input_names);
updates->enroll(std::move(update));
}
diff --git a/compiler/moco/import/src/Nodes/Concat.cpp b/compiler/moco/import/src/Nodes/Concat.cpp
index 8bf8a84b5..dea60a737 100644
--- a/compiler/moco/import/src/Nodes/Concat.cpp
+++ b/compiler/moco/import/src/Nodes/Concat.cpp
@@ -21,9 +21,9 @@
#include <moco/Names.h>
#include <loco.h>
-#include <stdex/Memory.h>
#include <plier/tf/Convert.h>
+#include <memory>
#include <cassert>
namespace
@@ -35,7 +35,7 @@ class TFConcatV2GraphUpdate final : public GraphUpdate
{
public:
TFConcatV2GraphUpdate(TFConcatV2 *node, std::vector<TensorName> names)
- : _node(node), _names(names)
+ : _node(node), _names(names)
{
}
@@ -102,7 +102,7 @@ void ConcatV2GraphBuilder::build(const tensorflow::NodeDef &node,
TensorName output_name(node.name(), 0);
tensor_names->enroll(output_name, concat_node);
- auto update = stdex::make_unique<TFConcatV2GraphUpdate>(concat_node, input_names);
+ auto update = std::make_unique<TFConcatV2GraphUpdate>(concat_node, input_names);
updates->enroll(std::move(update));
}
diff --git a/compiler/moco/import/src/Nodes/Const.cpp b/compiler/moco/import/src/Nodes/Const.cpp
index 15ea717db..7744cf889 100644
--- a/compiler/moco/import/src/Nodes/Const.cpp
+++ b/compiler/moco/import/src/Nodes/Const.cpp
@@ -228,7 +228,7 @@ void ConstGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderConte
read_value_float32(const_node, num_elements, input_tensor);
break;
- // TODO support other types
+ // TODO support other types
default:
assert(false);
diff --git a/compiler/moco/import/src/Nodes/Conv2D.cpp b/compiler/moco/import/src/Nodes/Conv2D.cpp
index e6b98dcd1..acb9f76c6 100644
--- a/compiler/moco/import/src/Nodes/Conv2D.cpp
+++ b/compiler/moco/import/src/Nodes/Conv2D.cpp
@@ -24,10 +24,10 @@
#include <loco.h>
#include <loco/IR/PermutingCodec.h>
-#include <stdex/Memory.h>
#include <plier/tf/Convert.h>
#include <oops/UserExn.h>
+#include <memory>
#include <cassert>
#include <stdexcept>
#include <algorithm>
@@ -131,7 +131,7 @@ void Conv2DGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderCont
input_names.push_back(TensorName(node.input(1))); // kernel
// Record ifm inputs to featureEncode_node
- auto tfconv2d_update = stdex::make_unique<TFConv2DGraphUpdate>(conv2d, input_names);
+ auto tfconv2d_update = std::make_unique<TFConv2DGraphUpdate>(conv2d, input_names);
updates->enroll(std::move(tfconv2d_update));
}
diff --git a/compiler/moco/import/src/Nodes/Conv2DBackpropInput.cpp b/compiler/moco/import/src/Nodes/Conv2DBackpropInput.cpp
index 74c6605ab..10fee9a8e 100644
--- a/compiler/moco/import/src/Nodes/Conv2DBackpropInput.cpp
+++ b/compiler/moco/import/src/Nodes/Conv2DBackpropInput.cpp
@@ -21,10 +21,11 @@
#include "Convert.h"
#include <loco.h>
-#include <stdex/Memory.h>
#include <plier/tf/Convert.h>
#include <oops/UserExn.h>
+#include <memory>
+
namespace
{
using namespace moco;
@@ -34,7 +35,7 @@ class Conv2DBackpropInputGraphUpdate final : public GraphUpdate
{
public:
Conv2DBackpropInputGraphUpdate(TFConv2DBackpropInput *node, std::vector<TensorName> names)
- : _node(node), _input_names(names)
+ : _node(node), _input_names(names)
{
// DO NOTHING
}
@@ -132,7 +133,7 @@ void Conv2DBackpropInputGraphBuilder::build(const tensorflow::NodeDef &node,
// update
auto conv2d_backprop_update =
- stdex::make_unique<Conv2DBackpropInputGraphUpdate>(conv2d_backprop, input_names);
+ std::make_unique<Conv2DBackpropInputGraphUpdate>(conv2d_backprop, input_names);
updates->enroll(std::move(conv2d_backprop_update));
}
diff --git a/compiler/moco/import/src/Nodes/DepthwiseConv2dNative.cpp b/compiler/moco/import/src/Nodes/DepthwiseConv2dNative.cpp
index 3991a4d51..62e57207d 100644
--- a/compiler/moco/import/src/Nodes/DepthwiseConv2dNative.cpp
+++ b/compiler/moco/import/src/Nodes/DepthwiseConv2dNative.cpp
@@ -24,9 +24,9 @@
#include <plier/tf/Convert.h>
#include <loco/IR/PermutingCodec.h>
-#include <stdex/Memory.h>
#include <oops/UserExn.h>
+#include <memory>
#include <cassert>
using namespace plier::tf;
@@ -39,7 +39,7 @@ class TFDepthwiseConv2dNativeGraphUpdate final : public GraphUpdate
{
public:
TFDepthwiseConv2dNativeGraphUpdate(TFDepthwiseConv2dNative *node, std::vector<TensorName> names)
- : _node(node), _names(names)
+ : _node(node), _names(names)
{
}
@@ -139,8 +139,8 @@ void DepthwiseConv2dNativeGraphBuilder::build(const tensorflow::NodeDef &node,
input_names.push_back(TensorName(node.input(1))); // kernel
// Record ifm inputs to featureEncode_node
- auto tfdepthwiseconv2dnative_update = stdex::make_unique<TFDepthwiseConv2dNativeGraphUpdate>(
- depthwiseconv2d_native_node, input_names);
+ auto tfdepthwiseconv2dnative_update =
+ std::make_unique<TFDepthwiseConv2dNativeGraphUpdate>(depthwiseconv2d_native_node, input_names);
updates->enroll(std::move(tfdepthwiseconv2dnative_update));
}
diff --git a/compiler/moco/import/src/Nodes/FakeQuantWithMinMaxVars.cpp b/compiler/moco/import/src/Nodes/FakeQuantWithMinMaxVars.cpp
index d2fa3d1eb..0bd354dc5 100644
--- a/compiler/moco/import/src/Nodes/FakeQuantWithMinMaxVars.cpp
+++ b/compiler/moco/import/src/Nodes/FakeQuantWithMinMaxVars.cpp
@@ -24,8 +24,8 @@
#include <plier/tf/Convert.h>
#include <loco/IR/PermutingCodec.h>
-#include <stdex/Memory.h>
+#include <memory>
#include <cassert>
using namespace plier::tf;
@@ -39,7 +39,7 @@ class TFFakeQuantWithMinMaxVarsGraphUpdate final : public GraphUpdate
public:
TFFakeQuantWithMinMaxVarsGraphUpdate(TFFakeQuantWithMinMaxVars *node,
std::vector<TensorName> names)
- : _node(node), _names(names)
+ : _node(node), _names(names)
{
}
@@ -115,7 +115,7 @@ void FakeQuantWithMinMaxVarsGraphBuilder::build(const tensorflow::NodeDef &node,
// Record ifm inputs to featureEncode_node
auto tffakequant_update =
- stdex::make_unique<TFFakeQuantWithMinMaxVarsGraphUpdate>(fakequant_node, input_names);
+ std::make_unique<TFFakeQuantWithMinMaxVarsGraphUpdate>(fakequant_node, input_names);
updates->enroll(std::move(tffakequant_update));
}
diff --git a/compiler/moco/import/src/Nodes/FusedBatchNorm.cpp b/compiler/moco/import/src/Nodes/FusedBatchNorm.cpp
index 59f98017c..8fc439ae3 100644
--- a/compiler/moco/import/src/Nodes/FusedBatchNorm.cpp
+++ b/compiler/moco/import/src/Nodes/FusedBatchNorm.cpp
@@ -19,9 +19,10 @@
#include <moco/IR/Nodes/TFFusedBatchNorm.h>
#include <loco.h>
-#include <stdex/Memory.h>
#include <plier/tf/Convert.h>
+#include <memory>
+
namespace
{
@@ -34,7 +35,7 @@ class FusedBatchNormGraphUpdate final : public GraphUpdate
{
public:
FusedBatchNormGraphUpdate(TFFusedBatchNorm *node, std::vector<TensorName> names)
- : _node(node), _names(names)
+ : _node(node), _names(names)
{
}
@@ -95,7 +96,7 @@ void FusedBatchNormGraphBuilder::build(const tensorflow::NodeDef &node,
fbn_input_names.push_back(TensorName(node.input(3))); // mean
fbn_input_names.push_back(TensorName(node.input(4))); // variance
- auto tf_fbn_update = stdex::make_unique<FusedBatchNormGraphUpdate>(tf_fbn, fbn_input_names);
+ auto tf_fbn_update = std::make_unique<FusedBatchNormGraphUpdate>(tf_fbn, fbn_input_names);
updates->enroll(std::move(tf_fbn_update));
}
diff --git a/compiler/moco/import/src/Nodes/Identity.cpp b/compiler/moco/import/src/Nodes/Identity.cpp
index 8ca0e2d01..c3b912b48 100644
--- a/compiler/moco/import/src/Nodes/Identity.cpp
+++ b/compiler/moco/import/src/Nodes/Identity.cpp
@@ -20,8 +20,8 @@
#include <moco/Names.h>
#include <loco.h>
-#include <stdex/Memory.h>
+#include <memory>
#include <vector>
namespace
@@ -33,7 +33,7 @@ class TFIdentityGraphUpdate final : public GraphUpdate
{
public:
TFIdentityGraphUpdate(TFIdentity *node, const std::vector<TensorName> &names)
- : _node(node), _names(names)
+ : _node(node), _names(names)
{
}
@@ -88,7 +88,7 @@ void IdentityGraphBuilder::build(const tensorflow::NodeDef &node,
{
names.emplace_back(TensorName(node.input(i)));
}
- auto update = stdex::make_unique<TFIdentityGraphUpdate>(identity_node, names);
+ auto update = std::make_unique<TFIdentityGraphUpdate>(identity_node, names);
updates->enroll(std::move(update));
}
diff --git a/compiler/moco/import/src/Nodes/MaxPool.cpp b/compiler/moco/import/src/Nodes/MaxPool.cpp
index 63275a3b8..cf4b21224 100644
--- a/compiler/moco/import/src/Nodes/MaxPool.cpp
+++ b/compiler/moco/import/src/Nodes/MaxPool.cpp
@@ -24,10 +24,10 @@
#include <loco.h>
#include <loco/IR/PermutingCodec.h>
-#include <stdex/Memory.h>
#include <plier/tf/Convert.h>
#include <oops/UserExn.h>
+#include <memory>
#include <cassert>
#include <stdexcept>
@@ -40,7 +40,7 @@ class TFMaxPoolGraphUpdate final : public GraphUpdate
{
public:
TFMaxPoolGraphUpdate(TFMaxPool *node, const TensorName &name)
- : _maxpool_node(node), _input_name(name)
+ : _maxpool_node(node), _input_name(name)
{
}
@@ -132,7 +132,7 @@ void MaxPoolGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderCon
tensor_names->enroll(output_name, maxPool_node);
// Record ifm inputs to featureEncode_node
- auto update = stdex::make_unique<TFMaxPoolGraphUpdate>(maxPool_node, TensorName(node.input(0)));
+ auto update = std::make_unique<TFMaxPoolGraphUpdate>(maxPool_node, TensorName(node.input(0)));
updates->enroll(std::move(update));
}
diff --git a/compiler/moco/import/src/Nodes/Maximum.cpp b/compiler/moco/import/src/Nodes/Maximum.cpp
index 43bbbabe6..d2d039f27 100644
--- a/compiler/moco/import/src/Nodes/Maximum.cpp
+++ b/compiler/moco/import/src/Nodes/Maximum.cpp
@@ -19,7 +19,8 @@
#include <moco/IR/Nodes/TFMaximum.h>
#include <loco.h>
-#include <stdex/Memory.h>
+
+#include <memory>
namespace
{
@@ -80,7 +81,7 @@ void MaximumGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderCon
add_input_names.push_back(TensorName(node.input(0))); // x
add_input_names.push_back(TensorName(node.input(1))); // y
- auto tf_maximum_update = stdex::make_unique<TFMaximumGraphUpdate>(tf_maximum, add_input_names);
+ auto tf_maximum_update = std::make_unique<TFMaximumGraphUpdate>(tf_maximum, add_input_names);
updates->enroll(std::move(tf_maximum_update));
}
diff --git a/compiler/moco/import/src/Nodes/Mean.cpp b/compiler/moco/import/src/Nodes/Mean.cpp
index 30fb0f1f7..3f559bc41 100644
--- a/compiler/moco/import/src/Nodes/Mean.cpp
+++ b/compiler/moco/import/src/Nodes/Mean.cpp
@@ -19,9 +19,10 @@
#include <moco/IR/Nodes/TFMean.h>
#include <loco.h>
-#include <stdex/Memory.h>
#include <plier/tf/Convert.h>
+#include <memory>
+
namespace
{
using namespace moco;
@@ -34,7 +35,7 @@ class MeanGraphUpdate final : public GraphUpdate
public:
MeanGraphUpdate(TFMean *node, const TensorName &&input_name,
const TensorName &&reduction_indices_name)
- : _node(node), _input_name(input_name), _reduction_indices_name(reduction_indices_name)
+ : _node(node), _input_name(input_name), _reduction_indices_name(reduction_indices_name)
{
// DO NOTHING
}
@@ -91,8 +92,8 @@ void MeanGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderContex
TensorName output_name(node.name(), 0);
tensor_names->enroll(output_name, tf_mean);
- auto update = stdex::make_unique<MeanGraphUpdate>(tf_mean, TensorName(node.input(0)),
- TensorName(node.input(1)));
+ auto update = std::make_unique<MeanGraphUpdate>(tf_mean, TensorName(node.input(0)),
+ TensorName(node.input(1)));
updates->enroll(std::move(update));
}
diff --git a/compiler/moco/import/src/Nodes/Mul.cpp b/compiler/moco/import/src/Nodes/Mul.cpp
index ab926b59e..91c5a60e5 100644
--- a/compiler/moco/import/src/Nodes/Mul.cpp
+++ b/compiler/moco/import/src/Nodes/Mul.cpp
@@ -19,7 +19,8 @@
#include <moco/IR/Nodes/TFMul.h>
#include <loco.h>
-#include <stdex/Memory.h>
+
+#include <memory>
namespace
{
@@ -78,7 +79,7 @@ void MulGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderContext
add_input_names.push_back(TensorName(node.input(0))); // x
add_input_names.push_back(TensorName(node.input(1))); // y
- auto tf_mul_update = stdex::make_unique<TFMulGraphUpdate>(tf_mul, add_input_names);
+ auto tf_mul_update = std::make_unique<TFMulGraphUpdate>(tf_mul, add_input_names);
updates->enroll(std::move(tf_mul_update));
}
diff --git a/compiler/moco/import/src/Nodes/Pack.cpp b/compiler/moco/import/src/Nodes/Pack.cpp
index 45815a30e..153ee44ef 100644
--- a/compiler/moco/import/src/Nodes/Pack.cpp
+++ b/compiler/moco/import/src/Nodes/Pack.cpp
@@ -23,9 +23,9 @@
#include <loco.h>
#include <loco/IR/NodeShape.h>
-#include <stdex/Memory.h>
#include <plier/tf/Convert.h>
+#include <memory>
#include <cassert>
namespace
@@ -95,7 +95,7 @@ void PackGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderContex
TensorName output_name(node.name(), 0);
tensor_names->enroll(output_name, pack_node);
- auto update = stdex::make_unique<TFPackGraphUpdate>(pack_node, input_names);
+ auto update = std::make_unique<TFPackGraphUpdate>(pack_node, input_names);
updates->enroll(std::move(update));
}
diff --git a/compiler/moco/import/src/Nodes/Pad.cpp b/compiler/moco/import/src/Nodes/Pad.cpp
index 262a68fa0..c1f466b44 100644
--- a/compiler/moco/import/src/Nodes/Pad.cpp
+++ b/compiler/moco/import/src/Nodes/Pad.cpp
@@ -19,9 +19,10 @@
#include <moco/IR/Nodes/TFPad.h>
#include <loco.h>
-#include <stdex/Memory.h>
#include <plier/tf/Convert.h>
+#include <memory>
+
namespace
{
@@ -84,7 +85,7 @@ void PadGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderContext
add_input_names.push_back(TensorName(node.input(1))); // paddings
// Queue node input update
- auto tf_pad_update = stdex::make_unique<TFPadGraphUpdate>(tf_pad, add_input_names);
+ auto tf_pad_update = std::make_unique<TFPadGraphUpdate>(tf_pad, add_input_names);
updates->enroll(std::move(tf_pad_update));
}
diff --git a/compiler/moco/import/src/Nodes/RealDiv.cpp b/compiler/moco/import/src/Nodes/RealDiv.cpp
index de3d57673..c747a2fb3 100644
--- a/compiler/moco/import/src/Nodes/RealDiv.cpp
+++ b/compiler/moco/import/src/Nodes/RealDiv.cpp
@@ -19,7 +19,8 @@
#include <moco/IR/Nodes/TFRealDiv.h>
#include <loco.h>
-#include <stdex/Memory.h>
+
+#include <memory>
namespace
{
@@ -79,7 +80,7 @@ void RealDivGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderCon
div_input_names.push_back(TensorName(node.input(0))); // x
div_input_names.push_back(TensorName(node.input(1))); // y
- auto tf_div_update = stdex::make_unique<TFRealDivGraphUpdate>(tf_div, div_input_names);
+ auto tf_div_update = std::make_unique<TFRealDivGraphUpdate>(tf_div, div_input_names);
updates->enroll(std::move(tf_div_update));
}
diff --git a/compiler/moco/import/src/Nodes/Relu.cpp b/compiler/moco/import/src/Nodes/Relu.cpp
index eedc8155d..c99e484e2 100644
--- a/compiler/moco/import/src/Nodes/Relu.cpp
+++ b/compiler/moco/import/src/Nodes/Relu.cpp
@@ -20,8 +20,8 @@
#include <moco/Names.h>
#include <loco.h>
-#include <stdex/Memory.h>
+#include <memory>
#include <cassert>
#include <stdexcept>
@@ -79,7 +79,7 @@ void ReluGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderContex
tensor_names->enroll(output_name, relu_node);
// Queue node input update
- auto update = stdex::make_unique<TFReluGraphUpdate>(relu_node, TensorName(node.input(0)));
+ auto update = std::make_unique<TFReluGraphUpdate>(relu_node, TensorName(node.input(0)));
updates->enroll(std::move(update));
}
diff --git a/compiler/moco/import/src/Nodes/Relu6.cpp b/compiler/moco/import/src/Nodes/Relu6.cpp
index 4700ba408..b7bbac5ce 100644
--- a/compiler/moco/import/src/Nodes/Relu6.cpp
+++ b/compiler/moco/import/src/Nodes/Relu6.cpp
@@ -18,7 +18,7 @@
#include <moco/IR/Nodes/TFRelu6.h>
-#include <stdex/Memory.h>
+#include <memory>
namespace
{
@@ -73,7 +73,7 @@ void Relu6GraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderConte
tensor_names->enroll(output_name, relu_node);
// Queue node input update
- auto update = stdex::make_unique<TFRelu6GraphUpdate>(relu_node, TensorName(node.input(0)));
+ auto update = std::make_unique<TFRelu6GraphUpdate>(relu_node, TensorName(node.input(0)));
updates->enroll(std::move(update));
}
diff --git a/compiler/moco/import/src/Nodes/Reshape.cpp b/compiler/moco/import/src/Nodes/Reshape.cpp
index 26e22513f..bdcafbf70 100644
--- a/compiler/moco/import/src/Nodes/Reshape.cpp
+++ b/compiler/moco/import/src/Nodes/Reshape.cpp
@@ -21,8 +21,8 @@
#include <moco/Names.h>
#include <plier/tf/Convert.h>
#include <loco.h>
-#include <stdex/Memory.h>
+#include <memory>
#include <cassert>
#include <stdexcept>
@@ -94,7 +94,7 @@ void ReshapeGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderCon
input_names.push_back(TensorName(node.input(1))); // shape
// Queue node input update
- auto update = stdex::make_unique<ReshapeGraphUpdate>(reshape, input_names);
+ auto update = std::make_unique<ReshapeGraphUpdate>(reshape, input_names);
updates->enroll(std::move(update));
}
diff --git a/compiler/moco/import/src/Nodes/Rsqrt.cpp b/compiler/moco/import/src/Nodes/Rsqrt.cpp
index 979ac90c9..f96d99b68 100644
--- a/compiler/moco/import/src/Nodes/Rsqrt.cpp
+++ b/compiler/moco/import/src/Nodes/Rsqrt.cpp
@@ -19,7 +19,8 @@
#include <moco/IR/Nodes/TFRsqrt.h>
#include <loco.h>
-#include <stdex/Memory.h>
+
+#include <memory>
namespace
{
@@ -74,8 +75,7 @@ void RsqrtGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderConte
tensor_names->enroll(output_name, tf_rsqrt);
// Queue node input update
- auto tf_rsqrt_update =
- stdex::make_unique<TFRsqrtGraphUpdate>(tf_rsqrt, TensorName(node.input(0)));
+ auto tf_rsqrt_update = std::make_unique<TFRsqrtGraphUpdate>(tf_rsqrt, TensorName(node.input(0)));
updates->enroll(std::move(tf_rsqrt_update));
}
diff --git a/compiler/moco/import/src/Nodes/Shape.cpp b/compiler/moco/import/src/Nodes/Shape.cpp
index 1e112ebb0..b7eb339ef 100644
--- a/compiler/moco/import/src/Nodes/Shape.cpp
+++ b/compiler/moco/import/src/Nodes/Shape.cpp
@@ -19,9 +19,10 @@
#include <moco/IR/Nodes/TFShape.h>
#include <loco.h>
-#include <stdex/Memory.h>
#include <plier/tf/Convert.h>
+#include <memory>
+
namespace
{
using namespace moco;
@@ -33,7 +34,7 @@ class ShapeGraphUpdate final : public GraphUpdate
{
public:
ShapeGraphUpdate(TFShape *node, const TensorName &&input_name)
- : _node(node), _input_name(input_name)
+ : _node(node), _input_name(input_name)
{
// DO NOTHING
}
@@ -93,7 +94,7 @@ void ShapeGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderConte
TensorName output_name(node.name(), 0);
tensor_names->enroll(output_name, tf_shape);
- auto update = stdex::make_unique<ShapeGraphUpdate>(tf_shape, TensorName(node.input(0)));
+ auto update = std::make_unique<ShapeGraphUpdate>(tf_shape, TensorName(node.input(0)));
updates->enroll(std::move(update));
}
diff --git a/compiler/moco/import/src/Nodes/Softmax.cpp b/compiler/moco/import/src/Nodes/Softmax.cpp
index 6f2c609ff..4fa962750 100644
--- a/compiler/moco/import/src/Nodes/Softmax.cpp
+++ b/compiler/moco/import/src/Nodes/Softmax.cpp
@@ -19,21 +19,22 @@
#include <moco/IR/Nodes/TFSoftmax.h>
#include <loco.h>
-#include <stdex/Memory.h>
#include <plier/tf/Convert.h>
+#include <memory>
+
namespace
{
using namespace moco;
/**
-* @brief GraphUpdate for Softmax node
-*/
+ * @brief GraphUpdate for Softmax node
+ */
class SoftmaxGraphUpdate final : public GraphUpdate
{
public:
SoftmaxGraphUpdate(TFSoftmax *node, const TensorName &&input_name)
- : _node(node), _input_name(input_name)
+ : _node(node), _input_name(input_name)
{
// DO NOTHING
}
@@ -79,7 +80,7 @@ void SoftmaxGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderCon
TensorName output_name(node.name(), 0);
tensor_names->enroll(output_name, tf_softmax);
- auto update = stdex::make_unique<SoftmaxGraphUpdate>(tf_softmax, TensorName(node.input(0)));
+ auto update = std::make_unique<SoftmaxGraphUpdate>(tf_softmax, TensorName(node.input(0)));
updates->enroll(std::move(update));
}
diff --git a/compiler/moco/import/src/Nodes/Sqrt.cpp b/compiler/moco/import/src/Nodes/Sqrt.cpp
index f891e48f6..0dbe15ede 100644
--- a/compiler/moco/import/src/Nodes/Sqrt.cpp
+++ b/compiler/moco/import/src/Nodes/Sqrt.cpp
@@ -19,7 +19,8 @@
#include <moco/IR/Nodes/TFSqrt.h>
#include <loco.h>
-#include <stdex/Memory.h>
+
+#include <memory>
namespace
{
@@ -74,7 +75,7 @@ void SqrtGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderContex
tensor_names->enroll(output_name, tf_sqrt);
// Queue node input update
- auto tf_sqrt_update = stdex::make_unique<TFSqrtGraphUpdate>(tf_sqrt, TensorName(node.input(0)));
+ auto tf_sqrt_update = std::make_unique<TFSqrtGraphUpdate>(tf_sqrt, TensorName(node.input(0)));
updates->enroll(std::move(tf_sqrt_update));
}
diff --git a/compiler/moco/import/src/Nodes/SquaredDifference.cpp b/compiler/moco/import/src/Nodes/SquaredDifference.cpp
index 17a1fe93d..441f02a19 100644
--- a/compiler/moco/import/src/Nodes/SquaredDifference.cpp
+++ b/compiler/moco/import/src/Nodes/SquaredDifference.cpp
@@ -19,7 +19,8 @@
#include <moco/IR/Nodes/TFSquaredDifference.h>
#include <loco.h>
-#include <stdex/Memory.h>
+
+#include <memory>
namespace
{
@@ -33,7 +34,7 @@ class TFSquaredDifferenceGraphUpdate final : public GraphUpdate
{
public:
TFSquaredDifferenceGraphUpdate(TFSquaredDifference *node, std::vector<TensorName> names)
- : _node(node), _names(names)
+ : _node(node), _names(names)
{
}
@@ -85,7 +86,7 @@ void SquaredDifferenceGraphBuilder::build(const tensorflow::NodeDef &node,
// Queue node input update
auto tf_sqrt_update =
- stdex::make_unique<TFSquaredDifferenceGraphUpdate>(tf_sqdiff, add_input_names);
+ std::make_unique<TFSquaredDifferenceGraphUpdate>(tf_sqdiff, add_input_names);
updates->enroll(std::move(tf_sqrt_update));
}
diff --git a/compiler/moco/import/src/Nodes/Squeeze.cpp b/compiler/moco/import/src/Nodes/Squeeze.cpp
index 1b4ebae6f..b013b840f 100644
--- a/compiler/moco/import/src/Nodes/Squeeze.cpp
+++ b/compiler/moco/import/src/Nodes/Squeeze.cpp
@@ -21,10 +21,11 @@
#include <moco/Names.h>
#include <loco.h>
-#include <stdex/Memory.h>
#include <plier/tf/Convert.h>
#include <oops/UserExn.h>
+#include <memory>
+
namespace
{
using namespace moco;
@@ -36,7 +37,7 @@ class SqueezeGraphUpdate final : public GraphUpdate
{
public:
SqueezeGraphUpdate(TFSqueeze *node, const TensorName &&input_name)
- : _node(node), _input_name(input_name)
+ : _node(node), _input_name(input_name)
{
// DO NOTHING
}
@@ -105,7 +106,7 @@ void SqueezeGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderCon
TensorName output_name(node.name(), 0);
tensor_names->enroll(output_name, tf_squeeze);
- auto update = stdex::make_unique<SqueezeGraphUpdate>(tf_squeeze, TensorName(node.input(0)));
+ auto update = std::make_unique<SqueezeGraphUpdate>(tf_squeeze, TensorName(node.input(0)));
updates->enroll(std::move(update));
}
diff --git a/compiler/moco/import/src/Nodes/StopGradient.cpp b/compiler/moco/import/src/Nodes/StopGradient.cpp
index 9caec6943..82f49dc4a 100644
--- a/compiler/moco/import/src/Nodes/StopGradient.cpp
+++ b/compiler/moco/import/src/Nodes/StopGradient.cpp
@@ -20,7 +20,8 @@
#include <loco.h>
#include <plier/tf/Convert.h>
-#include <stdex/Memory.h>
+
+#include <memory>
namespace
{
@@ -80,7 +81,7 @@ void StopGradientGraphBuilder::build(const tensorflow::NodeDef &node,
// Queue node input update
auto tf_stopgradient_update =
- stdex::make_unique<TFStopGradientGraphUpdate>(tf_stopgradient, TensorName(node.input(0)));
+ std::make_unique<TFStopGradientGraphUpdate>(tf_stopgradient, TensorName(node.input(0)));
updates->enroll(std::move(tf_stopgradient_update));
}
diff --git a/compiler/moco/import/src/Nodes/StridedSlice.cpp b/compiler/moco/import/src/Nodes/StridedSlice.cpp
index 06d388be0..b0744a7e2 100644
--- a/compiler/moco/import/src/Nodes/StridedSlice.cpp
+++ b/compiler/moco/import/src/Nodes/StridedSlice.cpp
@@ -24,10 +24,11 @@
#include "Convert.h"
#include <loco.h>
-#include <stdex/Memory.h>
#include <plier/tf/Convert.h>
#include <oops/UserExn.h>
+#include <memory>
+
namespace
{
using namespace moco;
@@ -36,7 +37,7 @@ class TFStridedSliceGraphUpdate final : public GraphUpdate
{
public:
TFStridedSliceGraphUpdate(TFStridedSlice *node, std::vector<TensorName> names)
- : _node(node), _names(names)
+ : _node(node), _names(names)
{
}
@@ -179,7 +180,7 @@ void StridedSliceGraphBuilder::build(const tensorflow::NodeDef &node,
input_names.push_back(TensorName(node.input(2))); // end
input_names.push_back(TensorName(node.input(3))); // strides
- auto tfconv2d_update = stdex::make_unique<TFStridedSliceGraphUpdate>(stridedslice, input_names);
+ auto tfconv2d_update = std::make_unique<TFStridedSliceGraphUpdate>(stridedslice, input_names);
updates->enroll(std::move(tfconv2d_update));
}
diff --git a/compiler/moco/import/src/Nodes/Sub.cpp b/compiler/moco/import/src/Nodes/Sub.cpp
index bdad81d67..4a657663e 100644
--- a/compiler/moco/import/src/Nodes/Sub.cpp
+++ b/compiler/moco/import/src/Nodes/Sub.cpp
@@ -19,7 +19,8 @@
#include <moco/IR/Nodes/TFSub.h>
#include <loco.h>
-#include <stdex/Memory.h>
+
+#include <memory>
namespace
{
@@ -78,7 +79,7 @@ void SubGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderContext
sub_input_names.push_back(TensorName(node.input(0))); // x
sub_input_names.push_back(TensorName(node.input(1))); // y
- auto tf_sub_update = stdex::make_unique<TFSubGraphUpdate>(tf_sub, sub_input_names);
+ auto tf_sub_update = std::make_unique<TFSubGraphUpdate>(tf_sub, sub_input_names);
updates->enroll(std::move(tf_sub_update));
}
diff --git a/compiler/moco/import/src/Nodes/Tanh.cpp b/compiler/moco/import/src/Nodes/Tanh.cpp
index c89fa862a..3a0b0a334 100644
--- a/compiler/moco/import/src/Nodes/Tanh.cpp
+++ b/compiler/moco/import/src/Nodes/Tanh.cpp
@@ -19,7 +19,8 @@
#include <moco/IR/Nodes/TFTanh.h>
#include <loco.h>
-#include <stdex/Memory.h>
+
+#include <memory>
namespace
{
@@ -74,7 +75,7 @@ void TanhGraphBuilder::build(const tensorflow::NodeDef &node, GraphBuilderContex
tensor_names->enroll(output_name, tf_tanh);
// Queue node input update
- auto tf_tanh_update = stdex::make_unique<TFTanhGraphUpdate>(tf_tanh, TensorName(node.input(0)));
+ auto tf_tanh_update = std::make_unique<TFTanhGraphUpdate>(tf_tanh, TensorName(node.input(0)));
updates->enroll(std::move(tf_tanh_update));
}
diff --git a/compiler/moco/import/src/TestHelper.test.cpp b/compiler/moco/import/src/TestHelper.test.cpp
index 06c3dd372..d0390ad32 100644
--- a/compiler/moco/import/src/TestHelper.test.cpp
+++ b/compiler/moco/import/src/TestHelper.test.cpp
@@ -17,7 +17,8 @@
#include "TestHelper.h"
#include <moco/IR/Nodes/TFConst.h>
-#include <stdex/Memory.h>
+
+#include <memory>
#include <gtest/gtest.h>
@@ -29,7 +30,7 @@ namespace test
TFNodeBuildTester::TFNodeBuildTester()
{
_graph = loco::make_graph();
- _tensor_names = stdex::make_unique<moco::SymbolTable>();
+ _tensor_names = std::make_unique<moco::SymbolTable>();
}
void TFNodeBuildTester::inputs(const std::vector<std::string> &names)
@@ -71,8 +72,8 @@ void TFNodeBuildTester::run(tensorflow::NodeDef &nodedef, moco::GraphBuilder &gr
{
assert(_output != nullptr);
- auto node_defs = stdex::make_unique<moco::NodeDefTable>();
- auto updates = stdex::make_unique<moco::UpdateQueue>();
+ auto node_defs = std::make_unique<moco::NodeDefTable>();
+ auto updates = std::make_unique<moco::UpdateQueue>();
moco::GraphBuilderContext gb_context(_graph.get(), node_defs.get(), _tensor_names.get(),
updates.get());