Two-stage workflow: explore and configure a model (introspection, dynamic-dimension binding) with GraphBuilder, then freeze it into an immutable, evaluable Function.
GraphBuilder b("model.onnx");
b.bind_dim("batch", 4);
Function f = b.create("net");
- Date
- 2026
Extra doc: https://github.com/casadi/casadi/wiki/L_2jd
Definition at line 49 of file graph_builder.hpp.
|
| std::string | type_name () const |
| | Readable name of the class. More...
|
| |
| | GraphBuilder () |
| | Default constructor. More...
|
| |
| | GraphBuilder (const std::string &model_path, const Dict &opts=Dict()) |
| | Construct from a model file (import lifecycle; format from the file suffix) More...
|
| |
| | GraphBuilder (const Function &f, const Dict &opts=Dict()) |
| | Construct from a CasADi Function (export lifecycle) More...
|
| |
| const std::string & | name () const |
| | Name of the model. More...
|
| |
| Function | create (const std::string &name, const std::vector< std::string > &name_in, const std::vector< std::string > &name_out, const Dict &opts=Dict()) const |
| | Freeze into an evaluable Function. More...
|
| |
| Function | create (const std::string &name, const Dict &opts=Dict()) const |
| | Freeze into an evaluable Function, exposing all model inputs and outputs. More...
|
| |
| Function | create () const |
| | Freeze into an evaluable Function, default naming. More...
|
| |
| void | export_onnx (const std::string &filename, const Dict &opts=Dict()) |
| | Export to an ONNX model file. 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...
|
| |
| 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...
|
| |
|
| casadi_int | n_in () const |
| | Declared shape of a tensor (input or output) by name; -1 for dynamic dimensions. More...
|
| |
| casadi_int | n_out () const |
| | Declared shape of a tensor (input or output) by name; -1 for dynamic dimensions. More...
|
| |
| std::vector< std::string > | name_in () const |
| | Declared shape of a tensor (input or output) by name; -1 for dynamic dimensions. More...
|
| |
| std::vector< std::string > | name_out () const |
| | Declared shape of a tensor (input or output) by name; -1 for dynamic dimensions. More...
|
| |
| std::vector< casadi_int > | dimension (const std::string &name) const |
| | Declared shape of a tensor (input or output) by name; -1 for dynamic dimensions. More...
|
| |
| std::string | dtype (const std::string &name) const |
| | Element type name of a tensor (input or output) by name (FLOAT, INT64, ...) More...
|
| |
| std::vector< std::string > | dimension_param (const std::string &name) const |
| | Per-axis symbolic dimension name of a tensor by name ("" for static axes) More...
|
| |
| std::vector< std::string > | dynamic_params () const |
| | Names of the symbolic/dynamic dimensions in the model. More...
|
| |
|
| void | bind_dim (const std::string ¶m, casadi_int value) |
| | Bind a symbolic/dynamic dimension to a concrete size. More...
|
| |
| void | bind_shape (const std::string &input_name, const std::vector< casadi_int > &shape) |
| | Pin the full shape of an input. More...
|
| |
| void | set (const std::string &input_name, const std::vector< double > &value) |
| | Bake a fixed value into an input; it is fed at create() and not exposed as a Function input. More...
|
| |
| void | set (const std::string &input_name, double value) |
| | Bake a scalar value into an input. More...
|
| |