Aidge export
Compare changes
Files
42+ 14
− 0
The goal of this MR is to add the possibility to export a neural network to a C++ code described with the Aidge API.
import aidge_core
import aidge_backend_cpu
import aidge_onnx
import numpy as np
graph = aidge_onnx.load_onnx("model.onnx")
aidge_core.remove_flatten(graph)
graph.compile('cpu', aidge_core.DataType.Float32, dims=[[1,3,32,32]])
in_tensor = aidge_core.Producer(aidge_core.Tensor(np.ones((1,3,32,32))), name="data")
in_tensor.get_operator().set_datatype(aidge_core.DataType.Float32)
in_tensor.get_operator().set_backend("cpu")
in_tensor.add_child(graph)
graph.add(in_tensor)
scheduler = aidge_core.SequentialScheduler(graph)
scheduler.generate_scheduling()
aidge_core.export("export_aidge", graph, scheduler)
This will generate the follwoing export:
.
+--- python_binding
| +--- pybind.cpp
+--- main.cpp
+--- version.txt
+--- CMakeLists.txt
+--- export-config.cmake.in
+--- project_name.txt
+--- cmake
| +--- PybindModuleCreation.cmake
| +--- CodeCoverage.cmake
+--- include
| +--- parameters
| | +--- _fc1_Gemm_output_0_2.hpp
| | +--- _fc2_Gemm_output_0_1.hpp
| | +--- _fc1_Gemm_output_0_1.hpp
| | +--- _conv1_Conv_output_0_1.hpp
| | +--- _conv2_Conv_output_0_2.hpp
| | +--- _conv1_Conv_output_0_0.hpp
| | +--- _conv1_Conv_output_0_2.hpp
| | +--- data_22_1.hpp
| | +--- _fc2_Gemm_output_0_2.hpp
| | +--- data_22_2.hpp
| | +--- _conv2_Conv_output_0_1.hpp
| +--- dnn.hpp
| +--- attributes
| | +--- _fc1_Gemm_output_0.hpp
| | +--- _pool_MaxPool_output_0.hpp
| | +--- _fc2_Gemm_output_0.hpp
| | +--- _pool_1_MaxPool_output_0.hpp
| | +--- data_22.hpp
| | +--- _conv2_Conv_output_0.hpp
| | +--- _conv1_Conv_output_0.hpp
+--- README.md
+--- src
| +--- dnn.cpp
PathLib
every whereaidge_core.export
-> aidge_core.export_utils
Copyright © Eclipse Foundation, Inc. All Rights Reserved. Privacy Policy | Terms of Use | Copyright Agent