#include <ModelEditor.h>
|
| ModelEditor (std::shared_ptr< CircleModel > circle_model) |
| Initialize the editor with CircleModel object.
|
|
ModelEditor & | resize_inputs (const std::vector< Shape > &new_inputs_shapes) |
| Resize the model. It means changing shape of the inputs and propagating changes through the graph.
|
|
The class to modify circle models.
Definition at line 33 of file ModelEditor.h.
◆ ModelEditor()
ModelEditor::ModelEditor |
( |
std::shared_ptr< CircleModel > |
circle_model | ) |
|
|
explicit |
Initialize the editor with CircleModel object.
Definition at line 67 of file ModelEditor.cpp.
68{
69 assert(circle_model != nullptr);
70}
◆ resize_inputs()
ModelEditor & ModelEditor::resize_inputs |
( |
const std::vector< Shape > & |
new_inputs_shapes | ) |
|
Resize the model. It means changing shape of the inputs and propagating changes through the graph.
Exceptions:
- std::runtime_error if the new_inputs_shapes are invalid. It can happens for scenarios like:
- new shapes for NOT all inputs are provided
- an exception was thrown during shape inference pass
Definition at line 72 of file ModelEditor.cpp.
73{
74 auto graph = _circle_model->module()->graph();
75 change_inputs_shapes(graph, new_inputs_shapes);
76
78 phase.emplace_back(std::make_unique<logo::RemoveDeadNodeWithQueryPass>());
79 phase.emplace_back(std::make_unique<luci::CircleShapeInferencePass>());
80 phase.emplace_back(std::make_unique<luci::CircleTypeInferencePass>());
81
83 try
84 {
85 phase_runner.run(phase);
86 }
87 catch (const std::exception &e)
88 {
89 throw std::runtime_error("Exception during resizing with message: " + std::string{e.what()});
90 }
91
92 return *this;
93}
std::vector< std::unique_ptr< Pass > > Phase
Referenced by entry().
The documentation for this class was generated from the following files: