Format-agnostic handle to a parsed computational-graph model. More...
#include <graph_model_impl.hpp>
Loaded by format name as a plugin (e.g. "onnx"); the concrete backend is the only place a heavy dependency (protobuf) is linked. The Fmu analogue for GraphBuilder. Internal: owned by GraphBuilderInternal, not exposed to the scripting layer.
Extra doc: https://github.com/casadi/casadi/wiki/L_2jc
| Id | Type | Description | Used in |
|---|---|---|---|
| verbose | OT_BOOL | Verbose evaluation – for debugging | casadi::GraphModel |
Definition at line 47 of file graph_model_impl.hpp.


Public Types | |
| using | internal_base_type = SharedObjectInternal |
| using | base_type = SharedObject |
Public Member Functions | |
| std::string | type_name () const |
| Readable name of the class. More... | |
| GraphModel () | |
| Default constructor (null handle) More... | |
| GraphModel (const std::string &format, const std::vector< uint8_t > &model_data=std::vector< uint8_t >(), const Dict &opts=Dict()) | |
| Load a backend for a format, optionally with parsed model bytes. More... | |
| std::string | format () const |
| Format name (plugin name) More... | |
| void | fill_metadata (GraphBuilderInternal &gb) const |
| Populate a builder's Node metadata from the parsed model. More... | |
| Function | import_symbolic (const GraphBuilderInternal &gb, const std::string &name) const |
| Symbolic import: rebuild the graph as a CasADi Function. More... | |
| std::vector< uint8_t > | export_symbolic (const Function &f, const Dict &opts=Dict()) |
| Symbolic export: serialize a CasADi Function to model bytes. More... | |
| const std::vector< uint8_t > & | model_data () const |
| Raw model bytes. More... | |
| std::string | class_name () const |
| Get class name. More... | |
| void | disp (std::ostream &stream, bool more=false) const |
| Print a description of the object. More... | |
| std::string | get_str (bool more=false) const |
| Get string representation. More... | |
| void | print_ptr (std::ostream &stream=casadi::uout()) const |
| void | own (SharedObjectInternal *node) |
| void | assign (SharedObjectInternal *node) |
| Assign the node to a node class pointer without reference counting. More... | |
| casadi_int | getCount () const |
| Get the reference count. More... | |
| void | swap (GenericShared &other) |
| Swap content with another instance. More... | |
| std::string | debug_repr () const |
| bool | is_null () const |
| Is a null pointer? More... | |
| casadi_int | __hash__ () const |
| Returns a number that is unique for a given Node. More... | |
| GenericWeakRef< SharedObject, SharedObjectInternal > * | weak () |
| Get a weak reference to the object. More... | |
| GraphModelInternal * | operator-> () |
| const GraphModelInternal * | operator-> () const |
| GraphModelInternal * | get () const |
Static Public Member Functions | |
| static bool | has_plugin (const std::string &name) |
| Check if a format plugin is available. More... | |
| static void | load_plugin (const std::string &name) |
| Explicitly load a format plugin. More... | |
| static std::string | doc (const std::string &name) |
| Get format-specific documentation. More... | |
Protected Member Functions | |
| void | count_up () |
| void | count_down () |
|
inherited |
Definition at line 103 of file shared_object.hpp.
|
inherited |
Definition at line 102 of file shared_object.hpp.
| casadi::GraphModel::GraphModel | ( | ) |
Definition at line 32 of file graph_model.cpp.
|
explicit |
Definition at line 35 of file graph_model.cpp.
References format(), casadi::PluginInterface< GraphModelInternal >::getPlugin(), model_data(), and casadi::GenericShared< SharedObject, SharedObjectInternal >::own().
|
inherited |
If the Object does not point to any node, "0" is returned.
Extra doc: https://github.com/casadi/casadi/wiki/L_av
Definition at line 123 of file generic_shared_impl.hpp.
|
inherited |
improper use will cause memory leaks!
Extra doc: https://github.com/casadi/casadi/wiki/L_at
Definition at line 96 of file generic_shared_impl.hpp.
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_au
Definition at line 31 of file shared_object.cpp.
Referenced by casadi::FmuFunction::check_mem_count(), casadi::MXFunction::export_code_body(), and casadi::BlazingSplineFunction::merge().
|
protectedinherited |
Definition at line 133 of file generic_shared_impl.hpp.
|
protectedinherited |
Definition at line 132 of file generic_shared_impl.hpp.
|
inherited |
Definition at line 112 of file generic_shared_impl.hpp.
|
inherited |
Definition at line 35 of file shared_object.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::is_null().
Referenced by casadi::Nlpsol::disp_more(), and casadi::CsparseInterface::nfact().
|
static |
Definition at line 73 of file graph_model.cpp.
References casadi::PluginInterface< GraphModelInternal >::getPlugin().
Referenced by casadi::doc_graphmodel().
| std::vector< uint8_t > casadi::GraphModel::export_symbolic | ( | const Function & | f, |
| const Dict & | opts = Dict() |
||
| ) |
Definition at line 62 of file graph_model.cpp.
Referenced by casadi::GraphBuilderInternal::export_onnx().
| void casadi::GraphModel::fill_metadata | ( | GraphBuilderInternal & | gb | ) | const |
Definition at line 53 of file graph_model.cpp.
Referenced by casadi::GraphBuilderInternal::GraphBuilderInternal().
| std::string casadi::GraphModel::format | ( | ) | const |
Definition at line 51 of file graph_model.cpp.
Referenced by GraphModel().
| GraphModelInternal * casadi::GraphModel::get | ( | ) | const |
Access functions of the node
Definition at line 47 of file graph_model.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::get().
Referenced by import_symbolic().
|
inlineinherited |
Definition at line 91 of file shared_object.hpp.
|
inherited |
Definition at line 102 of file generic_shared_impl.hpp.
|
static |
Definition at line 67 of file graph_model.cpp.
References casadi::PluginInterface< GraphModelInternal >::has_plugin().
Referenced by casadi::has_graphmodel().
| Function casadi::GraphModel::import_symbolic | ( | const GraphBuilderInternal & | gb, |
| const std::string & | name | ||
| ) | const |
Definition at line 56 of file graph_model.cpp.
References get(), and casadi::GraphModelInternal::import_symbolic().
Referenced by casadi::GraphBuilderInternal::create_function().
|
inherited |
Definition at line 116 of file generic_shared_impl.hpp.
|
static |
Definition at line 70 of file graph_model.cpp.
References casadi::PluginInterface< GraphModelInternal >::load_plugin().
Referenced by casadi::load_graphmodel().
| const std::vector< uint8_t > & casadi::GraphModel::model_data | ( | ) | const |
Definition at line 65 of file graph_model.cpp.
Referenced by GraphModel().
| GraphModelInternal * casadi::GraphModel::operator-> | ( | ) |
Access functions of the node
Definition at line 41 of file graph_model.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::operator->().
| const GraphModelInternal * casadi::GraphModel::operator-> | ( | ) | const |
Access functions of the node
Definition at line 44 of file graph_model.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::operator->().
|
inherited |
Assign the node to a node class pointer (or null)
Definition at line 89 of file generic_shared_impl.hpp.
|
inherited |
Print the pointer to the internal class
Definition at line 43 of file shared_object.cpp.
References casadi::GenericShared< SharedObject, SharedObjectInternal >::get().
|
inherited |
Definition at line 105 of file generic_shared_impl.hpp.
|
inline |
Definition at line 50 of file graph_model_impl.hpp.
|
inherited |
Extra doc: https://github.com/casadi/casadi/wiki/L_aw
Definition at line 130 of file generic_shared_impl.hpp.