add_executable(caffegen ${SOURCES})
target_include_directories(caffegen PRIVATE include)
-target_link_libraries(caffegen nncc_foundation)
+target_link_libraries(caffegen stdex)
target_link_libraries(caffegen cli)
target_link_libraries(caffegen caffeproto)
target_link_libraries(caffegen caffe)
#include "MergeCommand.h"
#include <cli/App.h>
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
#include <map>
#include <string>
+using stdex::make_unique;
+
int main(int argc, char **argv)
{
cli::App app{argv[0]};
// all receive data from stdin
- app.insert("init", nncc::foundation::make_unique<InitCommand>());
- app.insert("fill", nncc::foundation::make_unique<FillCommand>());
- app.insert("encode", nncc::foundation::make_unique<EncodeCommand>());
- app.insert("decode", nncc::foundation::make_unique<DecodeCommand>());
+ app.insert("init", make_unique<InitCommand>());
+ app.insert("fill", make_unique<FillCommand>());
+ app.insert("encode", make_unique<EncodeCommand>());
+ app.insert("decode", make_unique<DecodeCommand>());
// takes 2 args: prototxt model and caffemodel weights in that order
- app.insert("merge", nncc::foundation::make_unique<MergeCommand>());
+ app.insert("merge", make_unique<MergeCommand>());
return app.run(argc - 1, argv + 1);
}
#include <caffe/proto/caffe.pb.h>
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include <random>
#include <iostream>
+using stdex::make_unique;
+
int FillCommand::run(int, const char *const *) const
{
- auto param = nncc::foundation::make_unique<::caffe::NetParameter>();
+ auto param = make_unique<::caffe::NetParameter>();
// Read from standard input
google::protobuf::io::FileInputStream is{0};
#include "MergeCommand.h"
-#include <nncc/foundation/Memory.h>
#include <caffe/proto/caffe.pb.h>
#include <caffe/caffe.hpp>
#include "internal/InputLayer.h"
#include "internal/ConvolutionLayer.h"
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
+
+using stdex::make_unique;
template <typename T> std::shared_ptr<LayerFactory> make_factory(void)
{
{
std::unique_ptr<Layer> make(Network *net, caffe::LayerParameter *p) const override
{
- return nncc::foundation::make_unique<T>(net, p);
+ return make_unique<T>(net, p);
}
};
- return nncc::foundation::make_unique<LayerFactoryImpl>();
+ return make_unique<LayerFactoryImpl>();
}
LayerResolver::LayerResolver()
#include "internal/NetworkBuilder.h"
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
+
+using stdex::make_unique;
NetworkBuilder::NetworkBuilder(const LayerResolver &resolver) : _resolver{resolver}
{
std::unique_ptr<Network> NetworkBuilder::build(std::unique_ptr<caffe::NetParameter> &&p)
{
- auto res = nncc::foundation::make_unique<Network>(std::move(p));
+ auto res = make_unique<Network>(std::move(p));
for (int n = 0; n < res->param().layer_size(); ++n)
{