diff options
Diffstat (limited to 'compiler/moco')
62 files changed, 187 insertions, 175 deletions
diff --git a/compiler/moco/import/CMakeLists.txt b/compiler/moco/import/CMakeLists.txt index 43107776e..460c2c98b 100644 --- a/compiler/moco/import/CMakeLists.txt +++ b/compiler/moco/import/CMakeLists.txt @@ -7,7 +7,6 @@ target_include_directories(moco_import PRIVATE src) target_include_directories(moco_import PUBLIC include) target_link_libraries(moco_import PUBLIC moco_lang) target_link_libraries(moco_import PUBLIC mio_tf) -target_link_libraries(moco_import PUBLIC stdex) target_link_libraries(moco_import PRIVATE nncc_common) target_link_libraries(moco_import PRIVATE plier_tf) target_link_libraries(moco_import PRIVATE oops) diff --git a/compiler/moco/import/include/moco/Import/GraphBuilderContext.h b/compiler/moco/import/include/moco/Import/GraphBuilderContext.h index ae4f02c2a..76a9644b5 100644 --- a/compiler/moco/import/include/moco/Import/GraphBuilderContext.h +++ b/compiler/moco/import/include/moco/Import/GraphBuilderContext.h @@ -118,7 +118,7 @@ class GraphBuilderContext public: GraphBuilderContext(loco::Graph *g, NodeDefTable *nodedef, SymbolTable *tensor_names, UpdateQueue *updates) - : _g(g), _nodedef(nodedef), _tensor_names(tensor_names), _updates(updates) + : _g(g), _nodedef(nodedef), _tensor_names(tensor_names), _updates(updates) { // DO NOTHING } diff --git a/compiler/moco/import/include/moco/Import/GraphBuilderRegistry.h b/compiler/moco/import/include/moco/Import/GraphBuilderRegistry.h index da65cffb8..c99dca1cf 100644 --- a/compiler/moco/import/include/moco/Import/GraphBuilderRegistry.h +++ b/compiler/moco/import/include/moco/Import/GraphBuilderRegistry.h @@ -82,6 +82,6 @@ private: std::map<const std::string, std::unique_ptr<GraphBuilder>> _builder_map; }; -} // namespace mono +} // namespace moco #endif // __MOCO_IMPORT_GRAPH_BUILDER_REGISTRY_H__ diff --git a/compiler/moco/import/include/moco/Import/Nodes/Softmax.h b/compiler/moco/import/include/moco/Import/Nodes/Softmax.h index 43fbb8852..290818958 100644 --- a/compiler/moco/import/include/moco/Import/Nodes/Softmax.h +++ b/compiler/moco/import/include/moco/Import/Nodes/Softmax.h @@ -23,8 +23,8 @@ namespace moco { /** -* @brief GraphBuilder for Softmax node -*/ + * @brief GraphBuilder for Softmax node + */ class SoftmaxGraphBuilder final : public GraphBuilder { public: 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()); diff --git a/compiler/moco/lang/CMakeLists.txt b/compiler/moco/lang/CMakeLists.txt index a64fdf92a..2543f2563 100644 --- a/compiler/moco/lang/CMakeLists.txt +++ b/compiler/moco/lang/CMakeLists.txt @@ -7,7 +7,6 @@ target_include_directories(moco_lang PRIVATE src) target_include_directories(moco_lang PUBLIC include) target_link_libraries(moco_lang PUBLIC loco) target_link_libraries(moco_lang PRIVATE nncc_common) -target_link_libraries(moco_lang PRIVATE stdex) install(TARGETS moco_lang DESTINATION lib) # moco_tf_frontend requires moco_lang if(NOT ENABLE_TEST) diff --git a/compiler/moco/lang/include/moco/IR/Nodes/TFConv2DBackpropInput.h b/compiler/moco/lang/include/moco/IR/Nodes/TFConv2DBackpropInput.h index 43e620d24..69d867436 100644 --- a/compiler/moco/lang/include/moco/IR/Nodes/TFConv2DBackpropInput.h +++ b/compiler/moco/lang/include/moco/IR/Nodes/TFConv2DBackpropInput.h @@ -68,7 +68,7 @@ node { * Note that this convention is against loco canonical's convention. */ class TFConv2DBackpropInput final - : public FixedArityNode<3, TFNodeImpl<TFOpcode::Conv2DBackpropInput>> + : public FixedArityNode<3, TFNodeImpl<TFOpcode::Conv2DBackpropInput>> { public: loco::Node *input_sizes(void) const { return at(0)->node(); } diff --git a/compiler/moco/lang/include/moco/IR/Nodes/TFDepthwiseConv2dNative.h b/compiler/moco/lang/include/moco/IR/Nodes/TFDepthwiseConv2dNative.h index aefc0b5d9..2d7fa0c10 100644 --- a/compiler/moco/lang/include/moco/IR/Nodes/TFDepthwiseConv2dNative.h +++ b/compiler/moco/lang/include/moco/IR/Nodes/TFDepthwiseConv2dNative.h @@ -25,7 +25,7 @@ namespace moco { class TFDepthwiseConv2dNative final - : public FixedArityNode<2, TFNodeImpl<TFOpcode::DepthwiseConv2dNative>> + : public FixedArityNode<2, TFNodeImpl<TFOpcode::DepthwiseConv2dNative>> { public: loco::Node *input(void) const { return at(0)->node(); } diff --git a/compiler/moco/lang/include/moco/IR/Nodes/TFFakeQuantWithMinMaxVars.h b/compiler/moco/lang/include/moco/IR/Nodes/TFFakeQuantWithMinMaxVars.h index ec54da596..55baac7de 100644 --- a/compiler/moco/lang/include/moco/IR/Nodes/TFFakeQuantWithMinMaxVars.h +++ b/compiler/moco/lang/include/moco/IR/Nodes/TFFakeQuantWithMinMaxVars.h @@ -25,7 +25,7 @@ namespace moco { class TFFakeQuantWithMinMaxVars final - : public FixedArityNode<3, TFNodeImpl<TFOpcode::FakeQuantWithMinMaxVars>> + : public FixedArityNode<3, TFNodeImpl<TFOpcode::FakeQuantWithMinMaxVars>> { public: loco::Node *inputs(void) const { return at(0)->node(); } diff --git a/compiler/moco/lang/src/IR/TFDialect.cpp b/compiler/moco/lang/src/IR/TFDialect.cpp index 35bbcc2c9..959ef98f5 100644 --- a/compiler/moco/lang/src/IR/TFDialect.cpp +++ b/compiler/moco/lang/src/IR/TFDialect.cpp @@ -21,8 +21,7 @@ #include <loco/IR/GraphInputIndex.h> #include <loco/IR/GraphOutputIndex.h> -#include <stdex/Memory.h> - +#include <memory> #include <cassert> #include <stdexcept> @@ -78,8 +77,8 @@ namespace moco TFDialect::TFDialect() { - service<loco::GraphInputIndexQueryService>(stdex::make_unique<GiiQueryServiceImpl>()); - service<loco::GraphOutputIndexQueryService>(stdex::make_unique<GoiQueryServiceImpl>()); + service<loco::GraphInputIndexQueryService>(std::make_unique<GiiQueryServiceImpl>()); + service<loco::GraphOutputIndexQueryService>(std::make_unique<GoiQueryServiceImpl>()); } loco::Dialect *TFDialect::get(void) diff --git a/compiler/moco/lang/src/IR/TFNode.cpp b/compiler/moco/lang/src/IR/TFNode.cpp index ab9356196..b59a505b5 100644 --- a/compiler/moco/lang/src/IR/TFNode.cpp +++ b/compiler/moco/lang/src/IR/TFNode.cpp @@ -17,6 +17,8 @@ #include "moco/IR/TFNode.h" #include "moco/IR/TFDialect.h" +#include <limits> +#include <memory> #include <cassert> namespace moco @@ -26,9 +28,6 @@ const loco::Dialect *TFNode::dialect(void) const { return TFDialect::get(); } } // namespace moco -// TODO move this to appropriate place -#include <stdex/Memory.h> - namespace moco { @@ -60,7 +59,7 @@ loco::GraphInputIndex index(const TFPlaceholder *node) void index(TFPlaceholder *node, const loco::GraphInputIndex index) { - node->annot(stdex::make_unique<GraphInputIndexAnnotation>(index)); + node->annot(std::make_unique<GraphInputIndexAnnotation>(index)); } loco::TensorShape tensor_shape(const TFPlaceholder *node) diff --git a/compiler/moco/pass/CMakeLists.txt b/compiler/moco/pass/CMakeLists.txt index 1eba86283..40c3d5a49 100644 --- a/compiler/moco/pass/CMakeLists.txt +++ b/compiler/moco/pass/CMakeLists.txt @@ -9,7 +9,6 @@ target_link_libraries(moco_pass PUBLIC loco) target_link_libraries(moco_pass PUBLIC logo_core) target_link_libraries(moco_pass PUBLIC moco_lang) target_link_libraries(moco_pass PRIVATE moco_support) -target_link_libraries(moco_pass PRIVATE stdex) target_link_libraries(moco_pass PRIVATE oops) install(TARGETS moco_pass DESTINATION lib) @@ -23,4 +22,3 @@ GTest_AddTest(moco_pass_test ${TESTS}) target_include_directories(moco_pass_test PRIVATE src) target_link_libraries(moco_pass_test moco_pass) target_link_libraries(moco_pass_test moco_support) -target_link_libraries(moco_pass_test stdex) diff --git a/compiler/moco/pass/include/moco/Pass/Passes/ConstantFoldMul.h b/compiler/moco/pass/include/moco/Pass/Passes/ConstantFoldMul.h index 5528b8612..a5e25a0ce 100644 --- a/compiler/moco/pass/include/moco/Pass/Passes/ConstantFoldMul.h +++ b/compiler/moco/pass/include/moco/Pass/Passes/ConstantFoldMul.h @@ -26,7 +26,7 @@ namespace moco /** * @brief Constant folder for Const + Mul -> Const -*/ + */ class ConstantFoldMul : public logo::Pass { public: diff --git a/compiler/moco/pass/include/moco/Pass/Passes/ConstantFoldPack.h b/compiler/moco/pass/include/moco/Pass/Passes/ConstantFoldPack.h index fc6bc0ace..f99c633ac 100644 --- a/compiler/moco/pass/include/moco/Pass/Passes/ConstantFoldPack.h +++ b/compiler/moco/pass/include/moco/Pass/Passes/ConstantFoldPack.h @@ -28,7 +28,7 @@ namespace moco /** * @brief Constant folder for Const + Pack -> Const -*/ + */ class ConstantFoldPack : public logo::Pass { public: diff --git a/compiler/moco/pass/include/moco/Pass/Passes/ConstantFoldStridedSlice.h b/compiler/moco/pass/include/moco/Pass/Passes/ConstantFoldStridedSlice.h index 1e3492c2c..f57bdc05e 100644 --- a/compiler/moco/pass/include/moco/Pass/Passes/ConstantFoldStridedSlice.h +++ b/compiler/moco/pass/include/moco/Pass/Passes/ConstantFoldStridedSlice.h @@ -26,7 +26,7 @@ namespace moco /** * @brief Constant folder for Const + StridedSlice -> Const -*/ + */ class ConstantFoldStridedSlice : public logo::Pass { public: diff --git a/compiler/moco/pass/include/moco/Pass/Passes/FuseBinaryIntoPreceding.h b/compiler/moco/pass/include/moco/Pass/Passes/FuseBinaryIntoPreceding.h index 24e3567c0..4d5318c35 100644 --- a/compiler/moco/pass/include/moco/Pass/Passes/FuseBinaryIntoPreceding.h +++ b/compiler/moco/pass/include/moco/Pass/Passes/FuseBinaryIntoPreceding.h @@ -26,7 +26,7 @@ namespace moco /** * @brief Fuse TFAdd, TFMul to preceding TFConv2D or TFDepthWiseConv2D -*/ + */ class FuseBinaryIntoPreceding : public logo::Pass { public: diff --git a/compiler/moco/pass/include/moco/Pass/Passes/ResolveFusedBatchNorm.h b/compiler/moco/pass/include/moco/Pass/Passes/ResolveFusedBatchNorm.h index ce5ea0bb0..1910a9ac7 100644 --- a/compiler/moco/pass/include/moco/Pass/Passes/ResolveFusedBatchNorm.h +++ b/compiler/moco/pass/include/moco/Pass/Passes/ResolveFusedBatchNorm.h @@ -26,7 +26,7 @@ namespace moco /** * @brief Trasform TFFusedBatchNorm into TFAdd + TFRsqrt + TFMul + TFBatchNorm -*/ + */ class ResolveFusedBatchNorm : public logo::Pass { public: diff --git a/compiler/moco/pass/src/ConstantFoldAdd.test.cpp b/compiler/moco/pass/src/ConstantFoldAdd.test.cpp index bc9489fbd..fdfbfb8d3 100644 --- a/compiler/moco/pass/src/ConstantFoldAdd.test.cpp +++ b/compiler/moco/pass/src/ConstantFoldAdd.test.cpp @@ -19,7 +19,8 @@ #include <moco/IR/TFNodes.h> #include <loco.h> -#include <stdex/Memory.h> + +#include <memory> #include <gtest/gtest.h> @@ -60,7 +61,7 @@ TEST(ConstantFoldAdd, basic_vector) } setup_output_node(&graph, add_node); - auto pass = stdex::make_unique<moco::ConstantFoldAdd>(); + auto pass = std::make_unique<moco::ConstantFoldAdd>(); bool cont = true; while (cont) { @@ -92,7 +93,7 @@ TEST(ConstantFoldAdd, basic_refinedet_1) } setup_output_node(&graph, add_node); - auto pass = stdex::make_unique<moco::ConstantFoldAdd>(); + auto pass = std::make_unique<moco::ConstantFoldAdd>(); bool cont = true; while (cont) { diff --git a/compiler/moco/pass/src/ConstantFoldHelper.cpp b/compiler/moco/pass/src/ConstantFoldHelper.cpp index 79b04863c..9dd5e00cd 100644 --- a/compiler/moco/pass/src/ConstantFoldHelper.cpp +++ b/compiler/moco/pass/src/ConstantFoldHelper.cpp @@ -164,7 +164,7 @@ void apply_binary_s32(const moco::TFConst *lhs, const moco::TFConst *rhs, moco:: for (uint32_t e = 0; e < nume; e++) { output->at<loco::DataType::S32>(e) = - f.apply(lhs->at<loco::DataType::S32>(e), rhs->at<loco::DataType::S32>(e)); + f.apply(lhs->at<loco::DataType::S32>(e), rhs->at<loco::DataType::S32>(e)); } } @@ -180,7 +180,7 @@ void apply_binary_f32(const moco::TFConst *lhs, const moco::TFConst *rhs, moco:: for (uint32_t e = 0; e < nume; e++) { output->at<loco::DataType::FLOAT32>(e) = - f.apply(lhs->at<loco::DataType::FLOAT32>(e), rhs->at<loco::DataType::FLOAT32>(e)); + f.apply(lhs->at<loco::DataType::FLOAT32>(e), rhs->at<loco::DataType::FLOAT32>(e)); } } diff --git a/compiler/moco/pass/src/ConstantFoldMul.test.cpp b/compiler/moco/pass/src/ConstantFoldMul.test.cpp index 4e9b78fd4..c7e7d9e65 100644 --- a/compiler/moco/pass/src/ConstantFoldMul.test.cpp +++ b/compiler/moco/pass/src/ConstantFoldMul.test.cpp @@ -19,7 +19,8 @@ #include <moco/IR/TFNodes.h> #include <loco.h> -#include <stdex/Memory.h> + +#include <memory> #include <gtest/gtest.h> @@ -60,7 +61,7 @@ TEST(ConstantFoldMul, basic_vector) } setup_output_node(&graph, mul_node); - auto pass = stdex::make_unique<moco::ConstantFoldMul>(); + auto pass = std::make_unique<moco::ConstantFoldMul>(); bool cont = true; while (cont) { @@ -92,7 +93,7 @@ TEST(ConstantFoldMul, basic_refinedet_1) } setup_output_node(&graph, mul_node); - auto pass = stdex::make_unique<moco::ConstantFoldMul>(); + auto pass = std::make_unique<moco::ConstantFoldMul>(); bool cont = true; while (cont) { diff --git a/compiler/moco/pass/src/ConstantFoldPack.test.cpp b/compiler/moco/pass/src/ConstantFoldPack.test.cpp index cb6eff0c8..c0fa48c7b 100644 --- a/compiler/moco/pass/src/ConstantFoldPack.test.cpp +++ b/compiler/moco/pass/src/ConstantFoldPack.test.cpp @@ -19,7 +19,8 @@ #include <moco/IR/TFNodes.h> #include <loco.h> -#include <stdex/Memory.h> + +#include <memory> #include <gtest/gtest.h> @@ -69,7 +70,7 @@ TEST(ConstantFoldPack, basic_scalar4_vector) identity->input(pack_node); setup_output_node(&graph, identity); - auto pass = stdex::make_unique<moco::ConstantFoldPack>(); + auto pass = std::make_unique<moco::ConstantFoldPack>(); bool cont = true; while (cont) { diff --git a/compiler/moco/pass/src/ConstantFoldStridedSlice.test.cpp b/compiler/moco/pass/src/ConstantFoldStridedSlice.test.cpp index b5bada221..3e8449977 100644 --- a/compiler/moco/pass/src/ConstantFoldStridedSlice.test.cpp +++ b/compiler/moco/pass/src/ConstantFoldStridedSlice.test.cpp @@ -19,7 +19,8 @@ #include <moco/IR/TFNodes.h> #include <loco.h> -#include <stdex/Memory.h> + +#include <memory> #include <gtest/gtest.h> @@ -83,7 +84,7 @@ TEST(ConstantFoldStridedSlice, basic_matrix55_11) } setup_output_node(&graph, sslice_node); - auto pass = stdex::make_unique<moco::ConstantFoldStridedSlice>(); + auto pass = std::make_unique<moco::ConstantFoldStridedSlice>(); bool cont = true; while (cont) { @@ -121,7 +122,7 @@ TEST(ConstantFoldStridedSlice, basic_vector4_0) } setup_output_node(&graph, sslice_node); - auto pass = stdex::make_unique<moco::ConstantFoldStridedSlice>(); + auto pass = std::make_unique<moco::ConstantFoldStridedSlice>(); bool cont = true; while (cont) { @@ -157,7 +158,7 @@ TEST(ConstantFoldStridedSlice, basic_vector4_1) } setup_output_node(&graph, sslice_node); - auto pass = stdex::make_unique<moco::ConstantFoldStridedSlice>(); + auto pass = std::make_unique<moco::ConstantFoldStridedSlice>(); bool cont = true; while (cont) { @@ -193,7 +194,7 @@ TEST(ConstantFoldStridedSlice, basic_vector4_2) } setup_output_node(&graph, sslice_node); - auto pass = stdex::make_unique<moco::ConstantFoldStridedSlice>(); + auto pass = std::make_unique<moco::ConstantFoldStridedSlice>(); bool cont = true; while (cont) { diff --git a/compiler/moco/pass/src/Passes/FuseBinaryIntoPreceding.cpp b/compiler/moco/pass/src/Passes/FuseBinaryIntoPreceding.cpp index f97546a80..9374dd5f9 100644 --- a/compiler/moco/pass/src/Passes/FuseBinaryIntoPreceding.cpp +++ b/compiler/moco/pass/src/Passes/FuseBinaryIntoPreceding.cpp @@ -318,7 +318,7 @@ bool fuse_to_preceding(loco::Graph *graph, moco::TFMul *node) fused_node = fused_conv_node<FuseType::Conv2D, moco::TFConv2D>(graph, mulparam, conv2d); else if (auto dw_conv2d = dynamic_cast<moco::TFDepthwiseConv2dNative *>(precedingOp)) fused_node = fused_conv_node<FuseType::DepthwiseConv2D, moco::TFDepthwiseConv2dNative>( - graph, mulparam, dw_conv2d); + graph, mulparam, dw_conv2d); // Not ready yet if (fused_node == nullptr) @@ -515,7 +515,7 @@ bool FuseBinaryIntoPreceding::run(loco::Graph *graph) } } { - // TODO support Div + // TODO support Div } { diff --git a/compiler/moco/pass/src/Passes/ResolveSquaredDifference.cpp b/compiler/moco/pass/src/Passes/ResolveSquaredDifference.cpp index b66add1ae..44e92e9a7 100644 --- a/compiler/moco/pass/src/Passes/ResolveSquaredDifference.cpp +++ b/compiler/moco/pass/src/Passes/ResolveSquaredDifference.cpp @@ -24,8 +24,6 @@ #include <loco/IR/NodeShape.h> #include <loco/Service/ShapeInference.h> -#include <stdex/Memory.h> - namespace { diff --git a/compiler/moco/requires.cmake b/compiler/moco/requires.cmake index 1a7d36454..18b3a76aa 100644 --- a/compiler/moco/requires.cmake +++ b/compiler/moco/requires.cmake @@ -1,6 +1,5 @@ require("loco") require("locop") -require("stdex") require("moco-log") require("plier-tf") require("mio-tf") diff --git a/compiler/moco/service/CMakeLists.txt b/compiler/moco/service/CMakeLists.txt index dff0233b1..5213f718e 100644 --- a/compiler/moco/service/CMakeLists.txt +++ b/compiler/moco/service/CMakeLists.txt @@ -9,7 +9,6 @@ target_link_libraries(moco_service PUBLIC loco) target_link_libraries(moco_service PUBLIC moco_lang) target_link_libraries(moco_service PRIVATE moco_support) target_link_libraries(moco_service PRIVATE nncc_common) -target_link_libraries(moco_service PRIVATE stdex) target_link_libraries(moco_service PRIVATE oops) install(TARGETS moco_service DESTINATION lib) diff --git a/compiler/moco/service/src/Service/TFShapeInferenceRule.cpp b/compiler/moco/service/src/Service/TFShapeInferenceRule.cpp index 98434155e..6a9864dc5 100644 --- a/compiler/moco/service/src/Service/TFShapeInferenceRule.cpp +++ b/compiler/moco/service/src/Service/TFShapeInferenceRule.cpp @@ -302,7 +302,7 @@ public: // output count is from input count, depth is from kernel 'CM' which is dim(2) * dim(3) auto output_feature_shape = input_feature_shape; output_feature_shape.depth() = - loco::Dimension(ker_tensor_shape.dim(2).value() * ker_tensor_shape.dim(3).value()); + loco::Dimension(ker_tensor_shape.dim(2).value() * ker_tensor_shape.dim(3).value()); auto output_plane_shape = infer_plane_shape(input_plane_shape); diff --git a/compiler/moco/support/include/moco/Support/TFShapeInferenceHelper.h b/compiler/moco/support/include/moco/Support/TFShapeInferenceHelper.h index 52324700a..c8a547681 100644 --- a/compiler/moco/support/include/moco/Support/TFShapeInferenceHelper.h +++ b/compiler/moco/support/include/moco/Support/TFShapeInferenceHelper.h @@ -136,11 +136,11 @@ protected: if (_padding == "VALID") { res.height = - (p.input.height.value() + p.stride.height.value() - p.effective_window.height.value()) / - p.stride.height.value(); + (p.input.height.value() + p.stride.height.value() - p.effective_window.height.value()) / + p.stride.height.value(); res.width = - (p.input.width.value() + p.stride.width.value() - p.effective_window.width.value()) / - p.stride.width.value(); + (p.input.width.value() + p.stride.width.value() - p.effective_window.width.value()) / + p.stride.width.value(); } else if (_padding == "SAME") { diff --git a/compiler/moco/support/src/TFShapeInferenceHelper.cpp b/compiler/moco/support/src/TFShapeInferenceHelper.cpp index 13e514a78..605fb9c37 100644 --- a/compiler/moco/support/src/TFShapeInferenceHelper.cpp +++ b/compiler/moco/support/src/TFShapeInferenceHelper.cpp @@ -66,7 +66,7 @@ private: }; /** - * @breif Expand shape x and y to same rank by align right and filling with 1 + * @brief Expand shape x and y to same rank by align right and filling with 1 */ void expand_rank(loco::TensorShape &x, loco::TensorShape &y) { @@ -86,7 +86,7 @@ void expand_rank(loco::TensorShape &x, loco::TensorShape &y) } /** - * @breif Returns shape of expanded dimension of input x and y having same rank + * @brief Returns shape of expanded dimension of input x and y having same rank */ loco::TensorShape expand_dimension(const loco::TensorShape &x, const loco::TensorShape &y) { |