|
nndeploy C++ API
0.2.0
nndeploy C++ API
|
#include <node.h>
Public Member Functions | |
| base::Status | addDropdownParam (const std::string &dropdown_param, const std::vector< std::string > &dropdown_values) |
| Add dropdown parameter. More... | |
| base::Status | addIoParam (const std::string &io_param) |
| Add IO parameter. More... | |
| base::Status | addRequiredParam (const std::string &required_param) |
| Add required parameter. More... | |
| virtual base::Status | addResourceWithoutState (const std::string &key, const base::Any &value) |
| Add stateless resource. More... | |
| virtual base::Status | addResourceWithState (const std::string &key, Edge *edge) |
| Add stateful resource. More... | |
| base::Status | addUiParam (const std::string &ui_param) |
| Add UI parameter. More... | |
| bool | checkInputs (std::vector< Edge * > &inputs) |
| Check input edges. More... | |
| virtual bool | checkInterruptStatus () |
| Check interrupt status. More... | |
| bool | checkOutputs (std::vector< Edge * > &outputs) |
| Check output edges. More... | |
| bool | checkOutputs (std::vector< std::string > &outputs_name) |
| Check output edge names. More... | |
| base::Status | clearDropdownParams () |
| Clear dropdown parameters. More... | |
| virtual void | clearInterrupt () |
| Clear interrupt status. More... | |
| base::Status | clearIoParams () |
| Clear IO parameters. More... | |
| base::Status | clearRequiredParams () |
| Clear required parameters. More... | |
| base::Status | clearUiParams () |
| Clear UI parameters. More... | |
| virtual Edge * | createInternalOutputEdge (const std::string &name) |
| Create internal output edge. More... | |
| virtual Edge * | createResourceWithState (const std::string &key) |
| Create stateful resource. More... | |
| virtual base::Status | defaultParam () |
| Configure default parameters. More... | |
| virtual base::Status | deinit () |
| Deinitialize node. More... | |
| virtual base::Status | deserialize (const std::string &json_str) |
| Deserialize from JSON string. More... | |
| virtual base::Status | deserialize (rapidjson::Value &json) |
| Deserialize from JSON. More... | |
| virtual std::vector< Edge * > | forward () |
| Parameter-free forward propagation. More... | |
| virtual std::vector< Edge * > | forward (Edge *input) |
| Single input forward propagation. More... | |
| virtual std::vector< Edge * > | forward (std::vector< Edge * > inputs) |
| Node invocation interface. More... | |
| std::vector< Edge * > | getAllInput () |
| Get all input edges. More... | |
| std::vector< Edge * > | getAllOutput () |
| Get all output edges. More... | |
| size_t | getCompletedSize () |
| Get completed count. More... | |
| CompositeNode * | getCompositeNode () |
| Get parent composite node. More... | |
| bool | getConstructed () |
| Get whether it's constructed. More... | |
| bool | getDebugFlag () |
| Get debug flag. More... | |
| std::string | getDesc () |
| Get node description. More... | |
| std::string | getDeveloper () |
| Get developer information. More... | |
| virtual base::DeviceType | getDeviceType () |
| Get device type. More... | |
| std::map< std::string, std::vector< std::string > > | getDropdownParams () |
| Get dropdown parameters. More... | |
| virtual std::shared_ptr< base::Param > | getExternalParam (const std::string &key) |
| Get external parameter. More... | |
| Graph * | getGraph () |
| Get parent graph. More... | |
| bool | getGraphFlag () |
| Get graph flag. More... | |
| bool | getInitialized () |
| Get whether it's initialized. More... | |
| Edge * | getInput (int index=0) |
| Get input edge. More... | |
| int | getInputCount () |
| Get input edge count. More... | |
| template<typename T > | |
| T * | getInputData (int index=0) |
| Get input data (template method) More... | |
| int | getInputIndex (const std::string &name) |
| Get input edge index by name. More... | |
| std::string | getInputName (int index=0) |
| Get input edge name at specified index. More... | |
| std::vector< std::string > | getInputNames () |
| Get all input edge names. More... | |
| std::vector< std::shared_ptr< EdgeTypeInfo > > | getInputTypeInfo () |
| Get input type information. More... | |
| std::vector< std::string > | getIoParams () |
| Get IO parameter list. More... | |
| IOType | getIoType () |
| Get IO type. More... | |
| std::string | getKey () |
| Get node key. More... | |
| virtual int | getLoopCount () |
| Get loop count. More... | |
| virtual int64_t | getMemorySize () |
| Get memory size. More... | |
| std::string | getName () |
| Get node name. More... | |
| NodeType | getNodeType () |
| Get node type. More... | |
| Edge * | getOutput (int index=0) |
| Get output edge. More... | |
| int | getOutputCount () |
| Get output edge count. More... | |
| int | getOutputIndex (const std::string &name) |
| Get output edge index by name. More... | |
| std::string | getOutputName (int index=0) |
| Get output edge name at specified index. More... | |
| std::vector< std::string > | getOutputNames () |
| Get all output edge names. More... | |
| std::vector< std::shared_ptr< EdgeTypeInfo > > | getOutputTypeInfo () |
| Get output type information. More... | |
| virtual base::ParallelType | getParallelType () |
| Get parallel type. More... | |
| virtual base::Param * | getParam () |
| Get parameter. More... | |
| virtual base::Status | getParam (const std::string &key, base::Any &any) |
| Get parameter (Any type) More... | |
| virtual std::shared_ptr< base::Param > | getParamSharedPtr () |
| Get parameter (shared pointer) More... | |
| virtual std::vector< std::string > | getRealOutputsName () |
| Get real output names. More... | |
| std::vector< std::string > | getRequiredParams () |
| Get required parameter list. More... | |
| virtual base::Any & | getResourceWithoutState (const std::string &key) |
| Get stateless resource. More... | |
| template<typename T > | |
| T | getResourceWithoutState (const std::string &key) |
| Get stateless resource (template method) More... | |
| virtual Edge * | getResourceWithState (const std::string &key) |
| Get stateful resource. More... | |
| template<typename T > | |
| T * | getResourceWithState (const std::string &key) |
| Get stateful resource (template method) More... | |
| size_t | getRunSize () |
| Get run count. More... | |
| virtual std::shared_ptr< RunStatus > | getRunStatus () |
| Get run status. More... | |
| std::string | getSource () |
| Get source information. More... | |
| device::Stream * | getStream () |
| Get compute stream. More... | |
| bool | getTimeProfileFlag () |
| Get time profile flag. More... | |
| bool | getTraceFlag () |
| Get trace flag. More... | |
| std::vector< std::string > | getUiParams () |
| Get UI parameter list. More... | |
| std::string | getVersion () |
| Get version number. More... | |
| virtual base::Status | init () |
| Initialize node. More... | |
| virtual bool | interrupt () |
| Interrupt execution. More... | |
| bool | isDynamicInput () |
| Check if it's dynamic input. More... | |
| bool | isDynamicOutput () |
| Check if it's dynamic output. More... | |
| bool | isInputsChanged (std::vector< Edge * > inputs) |
| Check if inputs changed. More... | |
| bool | isRunning () |
| Check if it's running. More... | |
| virtual base::Status | loadFile (const std::string &path) |
| Load from file. More... | |
| Node (const std::string &name) | |
| Constructor. More... | |
| Node (const std::string &name, std::vector< Edge * > inputs, std::vector< Edge * > outputs) | |
| Constructor. More... | |
| virtual std::vector< Edge * > | operator() () |
| Parameter-free invocation operator overload. More... | |
| virtual std::vector< Edge * > | operator() (Edge *input) |
| Single input invocation operator overload. More... | |
| virtual std::vector< Edge * > | operator() (std::vector< Edge * > inputs) |
| Node invocation operator overload. More... | |
| base::Status | removeDropdownParam (const std::string &dropdown_param) |
| Remove dropdown parameter. More... | |
| base::Status | removeIoParam (const std::string &io_param) |
| Remove IO parameter. More... | |
| base::Status | removeRequiredParam (const std::string &required_param) |
| Remove required parameter. More... | |
| base::Status | removeUiParam (const std::string &ui_param) |
| Remove UI parameter. More... | |
| virtual base::Status | run ()=0 |
| Run node (pure virtual function) More... | |
| virtual base::Status | saveFile (const std::string &path) |
| Save to file. More... | |
| virtual std::string | serialize () |
| Serialize to JSON string. More... | |
| virtual base::Status | serialize (rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator) |
| Serialize to JSON. More... | |
| base::Status | setCompositeNode (CompositeNode *composite_node) |
| Set parent composite node. More... | |
| void | setDebugFlag (bool flag) |
| Set debug flag. More... | |
| void | setDesc (const std::string &desc) |
| Set node description. More... | |
| void | setDeveloper (const std::string &developer) |
| Set developer information. More... | |
| virtual base::Status | setDeviceType (base::DeviceType device_type) |
| Set device type. More... | |
| base::Status | setDropdownParams (const std::map< std::string, std::vector< std::string >> &dropdown_params) |
| Set dropdown parameters. More... | |
| void | setDynamicInput (bool is_dynamic_input) |
| Set whether it's dynamic input. More... | |
| void | setDynamicOutput (bool is_dynamic_output) |
| Set whether it's dynamic output. More... | |
| virtual base::Status | setExternalParam (const std::string &key, std::shared_ptr< base::Param > external_param) |
| Set external parameter. More... | |
| base::Status | setGraph (Graph *graph) |
| Set parent graph. More... | |
| void | setGraphFlag (bool flag) |
| Set graph flag. More... | |
| void | setInitializedFlag (bool flag) |
| Set initialized flag. More... | |
| void | setInnerFlag (bool flag) |
| Set inner flag. More... | |
| virtual base::Status | setInput (Edge *input, int index=-1) |
| Set input edge. More... | |
| virtual base::Status | setInputName (const std::string &name, int index=0) |
| Set input edge name. More... | |
| virtual base::Status | setInputNames (const std::vector< std::string > &names) |
| Set all input edge names. More... | |
| virtual base::Status | setInputs (std::vector< Edge * > inputs) |
| Set all input edges. More... | |
| virtual base::Status | setInputSharedPtr (std::shared_ptr< Edge > input, int index=-1) |
| Set input edge (shared pointer) More... | |
| virtual base::Status | setInputsSharedPtr (std::vector< std::shared_ptr< Edge >> inputs) |
| Set all input edges (shared pointer) More... | |
| base::Status | setInputTypeInfo (std::shared_ptr< EdgeTypeInfo > input_type_info, std::string desc="") |
| Set input type information. More... | |
| template<typename T > | |
| base::Status | setInputTypeInfo (std::string desc="") |
| Set input type information (template method) More... | |
| base::Status | setIoParams (const std::vector< std::string > &io_params) |
| Set IO parameter list. More... | |
| void | setIoType (IOType io_type) |
| Set IO type. More... | |
| virtual base::Status | setIterInput (Edge *input, int index=-1) |
| Set iteration input edge. More... | |
| void | setKey (const std::string &key) |
| Set node key. More... | |
| virtual void | setLoopCount (int loop_count) |
| Set loop count. More... | |
| virtual base::Status | setMemory (device::Buffer *buffer) |
| Set memory buffer. More... | |
| void | setName (const std::string &name) |
| Set node name. More... | |
| void | setNodeType (NodeType node_type) |
| Set node type. More... | |
| virtual base::Status | setOutput (Edge *output, int index=-1) |
| Set output edge. More... | |
| template<typename T > | |
| base::Status | setOutputData (T *obj, int index=0, bool is_external=true) |
| Set output data (template method) More... | |
| virtual base::Status | setOutputName (const std::string &name, int index=0) |
| Set output edge name. More... | |
| virtual base::Status | setOutputNames (const std::vector< std::string > &names) |
| Set all output edge names. More... | |
| virtual base::Status | setOutputs (std::vector< Edge * > outputs) |
| Set all output edges. More... | |
| virtual base::Status | setOutputSharedPtr (std::shared_ptr< Edge > output, int index=-1) |
| Set output edge (shared pointer) More... | |
| virtual base::Status | setOutputsSharedPtr (std::vector< std::shared_ptr< Edge >> outputs) |
| Set all output edges (shared pointer) More... | |
| base::Status | setOutputTypeInfo (std::shared_ptr< EdgeTypeInfo > output_type_info, std::string desc="") |
| Set output type information. More... | |
| template<typename T > | |
| base::Status | setOutputTypeInfo (std::string desc="") |
| Set output type information (template method) More... | |
| virtual base::Status | setParallelType (const base::ParallelType ¶lle_type) |
| Set parallel type. More... | |
| virtual base::Status | setParam (base::Param *param) |
| Set parameter. More... | |
| virtual base::Status | setParam (const std::string &key, base::Any &any) |
| Set parameter (Any type) More... | |
| virtual base::Status | setParam (const std::string &key, const std::string &value) |
| Set parameter (string type) More... | |
| virtual base::Status | setParamSharedPtr (std::shared_ptr< base::Param > param) |
| Set parameter (shared pointer) More... | |
| base::Status | setRequiredParams (const std::vector< std::string > &required_params) |
| Set required parameter list. More... | |
| template<typename T > | |
| base::Status | setResourceWithState (const std::string &key, T *value, bool is_external=true) |
| Set stateful resource (template method) More... | |
| void | setRunningFlag (bool flag) |
| Set running flag. More... | |
| void | setSource (const std::string &source) |
| Set source information. More... | |
| void | setStream (device::Stream *stream) |
| Set compute stream. More... | |
| void | setTimeProfileFlag (bool flag) |
| Set time profile flag. More... | |
| virtual void | setTraceFlag (bool flag) |
| Set trace flag. More... | |
| base::Status | setUiParams (const std::vector< std::string > &ui_params) |
| Set UI parameter list. More... | |
| base::Status | setVersion (const std::string &version) |
| Set version number. More... | |
| virtual bool | synchronize () |
| Synchronize execution. More... | |
| virtual base::Status | toStaticGraph () |
| Convert to static graph. More... | |
| virtual base::EdgeUpdateFlag | updateInput () |
| Update input. More... | |
| virtual | ~Node () |
Protected Attributes | |
| size_t | completed_size_ = 0 |
| Completed count. More... | |
| CompositeNode * | composite_node_ = nullptr |
| Parent composite node pointer. More... | |
| bool | constructed_ = false |
| Whether constructed. More... | |
| std::string | desc_ |
| Node description. More... | |
| std::string | developer_ |
| Developer information. More... | |
| base::DeviceType | device_type_ |
| Device type. More... | |
| std::map< std::string, std::vector< std::string > > | dropdown_params_ |
| Dropdown parameter mapping. More... | |
| std::map< std::string, std::shared_ptr< base::Param > > | external_param_ |
| External parameter mapping. More... | |
| Graph * | graph_ = nullptr |
| Parent graph pointer. More... | |
| bool | initialized_ = false |
| Whether initialized. More... | |
| std::vector< std::shared_ptr< EdgeTypeInfo > > | input_type_info_ |
| Input type information. More... | |
| std::vector< Edge * > | inputs_ |
| Input edge list. More... | |
| std::map< std::string, Edge * > | internal_outputs_ |
| Internal output edge mapping. More... | |
| std::vector< std::string > | io_params_ |
| IO parameter list. More... | |
| IOType | io_type_ = IOType::kIOTypeNone |
| IO type. More... | |
| bool | is_composite_node_ = false |
| Whether it's composite node. More... | |
| bool | is_condition_ = false |
| Whether it's condition node. More... | |
| bool | is_debug_ = false |
| Whether debugging is enabled. More... | |
| bool | is_dynamic_input_ = false |
| When node input/output is dynamic, cannot set input_type_info_ and output_type_info_. More... | |
| bool | is_dynamic_output_ = false |
| Whether it's dynamic output. More... | |
| bool | is_external_stream_ = false |
| Whether it's external stream. More... | |
| bool | is_graph_ = false |
| Whether it's graph node. More... | |
| bool | is_inner_ = false |
| Whether it's internal node in graph. More... | |
| bool | is_loop_ = false |
| Whether it's loop node. More... | |
| bool | is_running_ = false |
| Whether running. More... | |
| bool | is_time_profile_ = false |
| Whether time profiling is enabled. More... | |
| bool | is_trace_ = false |
| Whether tracing is enabled (when serialized to json, it must be static graph) More... | |
| std::string | key_ |
| Node key. More... | |
| int | loop_count_ = -1 |
| Loop count. More... | |
| std::string | name_ |
| Node name. More... | |
| NodeType | node_type_ = NodeType::kNodeTypeIntermediate |
| Node type. More... | |
| std::vector< std::shared_ptr< EdgeTypeInfo > > | output_type_info_ |
| Output type information. More... | |
| std::vector< Edge * > | outputs_ |
| Output edge list. More... | |
| base::ParallelType | parallel_type_ = base::kParallelTypeNone |
| Parallel type. More... | |
| bool | parallel_type_set_ = false |
| Whether parallel type is set. More... | |
| std::shared_ptr< base::Param > | param_ |
| Node parameters. More... | |
| std::vector< std::string > | required_params_ |
| Required parameter list. More... | |
| size_t | run_size_ = 0 |
| Run count. More... | |
| std::string | source_ |
| Source information. More... | |
| std::atomic< bool > | stop_ {false} |
| Stop flag. More... | |
| device::Stream * | stream_ = nullptr |
| Compute stream pointer. More... | |
| bool | traced_ = false |
| Whether traced. More... | |
| std::vector< std::string > | ui_params_ |
| UI parameter list. More... | |
| std::string | version_ = "1.0.0" |
| Version number. More... | |
Node base class.
Basic computational unit in DAG graph, each node is responsible for allocating memory for its output edges
| nndeploy::dag::Node::Node | ( | const std::string & | name | ) |
Constructor.
| name | Node name |
| nndeploy::dag::Node::Node | ( | const std::string & | name, |
| std::vector< Edge * > | inputs, | ||
| std::vector< Edge * > | outputs | ||
| ) |
Constructor.
| name | Node name |
| inputs | Input edge list |
| outputs | Output edge list |
|
virtual |
| base::Status nndeploy::dag::Node::addDropdownParam | ( | const std::string & | dropdown_param, |
| const std::vector< std::string > & | dropdown_values | ||
| ) |
Add dropdown parameter.
| dropdown_param | Dropdown parameter name |
| dropdown_values | Dropdown option value list |
| base::Status nndeploy::dag::Node::addIoParam | ( | const std::string & | io_param | ) |
Add IO parameter.
| io_param | IO parameter |
| base::Status nndeploy::dag::Node::addRequiredParam | ( | const std::string & | required_param | ) |
Add required parameter.
| required_param | Required parameter |
|
virtual |
Add stateless resource.
| key | Resource key |
| value | Resource value |
Reimplemented in nndeploy::dag::Graph.
|
virtual |
Add stateful resource.
| key | Resource key |
| edge | Edge pointer |
Reimplemented in nndeploy::dag::Graph.
| base::Status nndeploy::dag::Node::addUiParam | ( | const std::string & | ui_param | ) |
Add UI parameter.
| ui_param | UI parameter |
| bool nndeploy::dag::Node::checkInputs | ( | std::vector< Edge * > & | inputs | ) |
Check input edges.
| inputs | Input edge list |
|
virtual |
Check interrupt status.
| bool nndeploy::dag::Node::checkOutputs | ( | std::vector< Edge * > & | outputs | ) |
Check output edges.
| outputs | Output edge list |
| bool nndeploy::dag::Node::checkOutputs | ( | std::vector< std::string > & | outputs_name | ) |
Check output edge names.
| outputs_name | Output edge name list |
| base::Status nndeploy::dag::Node::clearDropdownParams | ( | ) |
Clear dropdown parameters.
|
virtual |
Clear interrupt status.
| base::Status nndeploy::dag::Node::clearIoParams | ( | ) |
Clear IO parameters.
| base::Status nndeploy::dag::Node::clearRequiredParams | ( | ) |
Clear required parameters.
| base::Status nndeploy::dag::Node::clearUiParams | ( | ) |
Clear UI parameters.
|
virtual |
|
virtual |
|
virtual |
Configure default parameters.
Reimplemented in nndeploy::qwen::QwenDecode, nndeploy::qwen::QwenPrefill, nndeploy::ocr::RecognizerGraph, nndeploy::ocr::DetectorGraph, nndeploy::ocr::ClassifierGraph, nndeploy::classification::ResnetGraph, nndeploy::classification::ClassificationGraph, nndeploy::dag::Graph, and nndeploy::dag::CompositeNode.
|
virtual |
Deinitialize node.
Reimplemented in nndeploy::llm::StreamOut, nndeploy::qwen::QwenDecode, nndeploy::qwen::QwenPrefill, nndeploy::llm::LlmInfer, nndeploy::llm::Embedding, nndeploy::infer::Infer, nndeploy::dag::Loop, nndeploy::dag::Graph, nndeploy::dag::ConstNode, nndeploy::dag::Condition, nndeploy::dag::CompositeNode, and nndeploy::dag::Comment.
|
virtual |
Deserialize from JSON string.
| json_str | JSON string |
Reimplemented in nndeploy::dag::Graph, and nndeploy::dag::CompositeNode.
|
virtual |
Deserialize from JSON.
| json | JSON value object |
Reimplemented in nndeploy::llm::StreamOut, nndeploy::llm::LlmInfer, nndeploy::llm::Decode, nndeploy::llm::AbstractLlmInfer, nndeploy::dag::FixedLoop, nndeploy::qwen::QwenDecode, nndeploy::qwen::QwenPrefill, nndeploy::qwen::PrintNode, nndeploy::preprocess::BatchPreprocess, nndeploy::llm::LlmOut, nndeploy::infer::Infer, nndeploy::codec::Encode, nndeploy::codec::Decode, nndeploy::dag::Graph, nndeploy::dag::Condition, and nndeploy::dag::CompositeNode.
|
virtual |
Single input forward propagation.
| input | Input edge |
Reimplemented in nndeploy::dag::Graph, nndeploy::llm::Prefill, and nndeploy::llm::Decode.
Node invocation interface.
Node invocation interface for inter-node calls
| inputs | Input edges |
Reimplemented in nndeploy::dag::Graph.
| std::vector<Edge *> nndeploy::dag::Node::getAllInput | ( | ) |
Get all input edges.
| std::vector<Edge *> nndeploy::dag::Node::getAllOutput | ( | ) |
Get all output edges.
| size_t nndeploy::dag::Node::getCompletedSize | ( | ) |
Get completed count.
| CompositeNode* nndeploy::dag::Node::getCompositeNode | ( | ) |
Get parent composite node.
| bool nndeploy::dag::Node::getConstructed | ( | ) |
Get whether it's constructed.
| bool nndeploy::dag::Node::getDebugFlag | ( | ) |
Get debug flag.
| std::string nndeploy::dag::Node::getDesc | ( | ) |
Get node description.
| std::string nndeploy::dag::Node::getDeveloper | ( | ) |
Get developer information.
|
virtual |
Get device type.
| std::map<std::string, std::vector<std::string> > nndeploy::dag::Node::getDropdownParams | ( | ) |
Get dropdown parameters.
|
virtual |
Get external parameter.
| key | Parameter key |
Reimplemented in nndeploy::dag::Graph.
| bool nndeploy::dag::Node::getGraphFlag | ( | ) |
Get graph flag.
| bool nndeploy::dag::Node::getInitialized | ( | ) |
Get whether it's initialized.
| Edge* nndeploy::dag::Node::getInput | ( | int | index = 0 | ) |
Get input edge.
| index | Input edge index, default is 0 |
| int nndeploy::dag::Node::getInputCount | ( | ) |
Get input edge count.
|
inline |
| int nndeploy::dag::Node::getInputIndex | ( | const std::string & | name | ) |
Get input edge index by name.
| name | Input edge name |
| std::string nndeploy::dag::Node::getInputName | ( | int | index = 0 | ) |
Get input edge name at specified index.
| index | Input edge index, default is 0 |
| std::vector<std::string> nndeploy::dag::Node::getInputNames | ( | ) |
Get all input edge names.
| std::vector<std::shared_ptr<EdgeTypeInfo> > nndeploy::dag::Node::getInputTypeInfo | ( | ) |
Get input type information.
| std::vector<std::string> nndeploy::dag::Node::getIoParams | ( | ) |
Get IO parameter list.
| IOType nndeploy::dag::Node::getIoType | ( | ) |
Get IO type.
| std::string nndeploy::dag::Node::getKey | ( | ) |
Get node key.
|
virtual |
|
virtual |
| std::string nndeploy::dag::Node::getName | ( | ) |
Get node name.
| Edge* nndeploy::dag::Node::getOutput | ( | int | index = 0 | ) |
Get output edge.
| index | Output edge index, default is 0 |
| int nndeploy::dag::Node::getOutputCount | ( | ) |
Get output edge count.
| int nndeploy::dag::Node::getOutputIndex | ( | const std::string & | name | ) |
Get output edge index by name.
| name | Output edge name |
| std::string nndeploy::dag::Node::getOutputName | ( | int | index = 0 | ) |
Get output edge name at specified index.
| index | Output edge index, default is 0 |
| std::vector<std::string> nndeploy::dag::Node::getOutputNames | ( | ) |
Get all output edge names.
| std::vector<std::shared_ptr<EdgeTypeInfo> > nndeploy::dag::Node::getOutputTypeInfo | ( | ) |
Get output type information.
|
virtual |
Get parallel type.
|
virtual |
Get parameter.
Reimplemented in nndeploy::preprocess::BatchPreprocess, and nndeploy::infer::Infer.
|
virtual |
Get parameter (Any type)
| key | Parameter key |
| any | Any type parameter reference |
|
virtual |
Get parameter (shared pointer)
Reimplemented in nndeploy::preprocess::BatchPreprocess, and nndeploy::infer::Infer.
|
virtual |
Get real output names.
| std::vector<std::string> nndeploy::dag::Node::getRequiredParams | ( | ) |
Get required parameter list.
|
virtual |
Get stateless resource.
| key | Resource key |
Reimplemented in nndeploy::dag::Graph.
|
inline |
|
virtual |
Get stateful resource.
| key | Resource key |
Reimplemented in nndeploy::dag::Graph.
|
inline |
| size_t nndeploy::dag::Node::getRunSize | ( | ) |
Get run count.
|
virtual |
Get run status.
| std::string nndeploy::dag::Node::getSource | ( | ) |
Get source information.
| device::Stream* nndeploy::dag::Node::getStream | ( | ) |
Get compute stream.
| bool nndeploy::dag::Node::getTimeProfileFlag | ( | ) |
Get time profile flag.
| bool nndeploy::dag::Node::getTraceFlag | ( | ) |
Get trace flag.
| std::vector<std::string> nndeploy::dag::Node::getUiParams | ( | ) |
Get UI parameter list.
| std::string nndeploy::dag::Node::getVersion | ( | ) |
Get version number.
|
virtual |
Initialize node.
Reimplemented in nndeploy::llm::StreamOut, nndeploy::qwen::QwenDecode, nndeploy::qwen::QwenPrefill, nndeploy::llm::LlmInfer, nndeploy::llm::Embedding, nndeploy::llm::DefaultLlmInfer, nndeploy::infer::Infer, nndeploy::dag::Loop, nndeploy::dag::Graph, nndeploy::dag::ConstNode, nndeploy::dag::Condition, nndeploy::dag::CompositeNode, and nndeploy::dag::Comment.
|
virtual |
| bool nndeploy::dag::Node::isDynamicInput | ( | ) |
Check if it's dynamic input.
| bool nndeploy::dag::Node::isDynamicOutput | ( | ) |
Check if it's dynamic output.
| bool nndeploy::dag::Node::isInputsChanged | ( | std::vector< Edge * > | inputs | ) |
Check if inputs changed.
| inputs | Input edge list |
| bool nndeploy::dag::Node::isRunning | ( | ) |
Check if it's running.
|
virtual |
Load from file.
| path | File path |
|
virtual |
Parameter-free invocation operator overload.
Reimplemented in nndeploy::dag::Graph.
Single input invocation operator overload.
| input | Input edge |
Reimplemented in nndeploy::dag::Graph.
Node invocation operator overload.
| inputs | Input edges |
Reimplemented in nndeploy::dag::Graph.
| base::Status nndeploy::dag::Node::removeDropdownParam | ( | const std::string & | dropdown_param | ) |
Remove dropdown parameter.
| dropdown_param | Dropdown parameter name |
| base::Status nndeploy::dag::Node::removeIoParam | ( | const std::string & | io_param | ) |
Remove IO parameter.
| io_param | IO parameter |
| base::Status nndeploy::dag::Node::removeRequiredParam | ( | const std::string & | required_param | ) |
Remove required parameter.
| required_param | Required parameter |
| base::Status nndeploy::dag::Node::removeUiParam | ( | const std::string & | ui_param | ) |
Remove UI parameter.
| ui_param | UI parameter |
|
pure virtual |
Run node (pure virtual function)
Implemented in nndeploy::tokenizer::TokenizerDecode, nndeploy::tokenizer::TokenizerEncode, nndeploy::llm::AbstractLlmInfer, nndeploy::codec::Encode, nndeploy::codec::Decode, nndeploy::dag::ConstNode, nndeploy::dag::CompositeNode, nndeploy::llm::StreamOut, nndeploy::track::VisMOT, nndeploy::super_resolution::SuperResolutionPostProcess, nndeploy::segment::DrawMask, nndeploy::qwen::QwenDecode, nndeploy::qwen::QwenPrefill, nndeploy::qwen::PrintNode, nndeploy::qwen::PromptNode, nndeploy::qwen::DecodeSampleNode, nndeploy::qwen::PrefillSampleNode, nndeploy::qwen::DecodeEmbeddingNode, nndeploy::qwen::PrefillEmbeddingNode, nndeploy::preprocess::WarpAffineCvtNormTrans, nndeploy::preprocess::CvtResizePadNormTrans, nndeploy::preprocess::CvtResizeNormTrans, nndeploy::preprocess::CvtResizeCropNormTrans, nndeploy::preprocess::CvtNormTrans, nndeploy::preprocess::ConvertTo, nndeploy::preprocess::BatchPreprocess, nndeploy::ocr::RecognizerPostProcess, nndeploy::ocr::RecognizerPreProcess, nndeploy::ocr::PrintOcrNode, nndeploy::ocr::RotateImage180, nndeploy::ocr::RotateCropImage, nndeploy::ocr::DrawDetectorBox, nndeploy::ocr::DetectorPostProcess, nndeploy::ocr::DetectorPreProcess, nndeploy::ocr::ClassifierPostProcess, nndeploy::ocr::ClassifierPreProcess, nndeploy::matting::VisMatting, nndeploy::llm::Sampler, nndeploy::llm::Prompt, nndeploy::llm::LlmOut, nndeploy::llm::LlmInfer, nndeploy::llm::Embedding, nndeploy::llm::DefaultLlmInfer, nndeploy::infer::Infer, nndeploy::detect::YoloMultiConvDrawBox, nndeploy::detect::DrawBox, nndeploy::classification::DrawLable, nndeploy::classification::ClassificationPostProcess, nndeploy::dag::Loop, nndeploy::dag::Graph, nndeploy::dag::Condition, and nndeploy::dag::Comment.
|
virtual |
Save to file.
| path | File path |
|
virtual |
Serialize to JSON string.
Reimplemented in nndeploy::dag::Condition, nndeploy::dag::Graph, nndeploy::dag::Condition, and nndeploy::dag::CompositeNode.
|
virtual |
Serialize to JSON.
| json | JSON value object |
| allocator | JSON allocator |
Reimplemented in nndeploy::llm::StreamOut, nndeploy::llm::LlmInfer, nndeploy::llm::Decode, nndeploy::llm::AbstractLlmInfer, nndeploy::dag::FixedLoop, nndeploy::qwen::QwenDecode, nndeploy::qwen::QwenPrefill, nndeploy::qwen::PrintNode, nndeploy::preprocess::BatchPreprocess, nndeploy::llm::LlmOut, nndeploy::infer::Infer, nndeploy::codec::Encode, nndeploy::codec::Decode, nndeploy::dag::Graph, nndeploy::dag::Condition, and nndeploy::dag::CompositeNode.
| base::Status nndeploy::dag::Node::setCompositeNode | ( | CompositeNode * | composite_node | ) |
Set parent composite node.
| composite_node | Composite node pointer |
| void nndeploy::dag::Node::setDebugFlag | ( | bool | flag | ) |
Set debug flag.
| flag | Flag value |
| void nndeploy::dag::Node::setDesc | ( | const std::string & | desc | ) |
Set node description.
| desc | Node description |
| void nndeploy::dag::Node::setDeveloper | ( | const std::string & | developer | ) |
Set developer information.
| developer | Developer name |
|
virtual |
Set device type.
| device_type | Device type |
| base::Status nndeploy::dag::Node::setDropdownParams | ( | const std::map< std::string, std::vector< std::string >> & | dropdown_params | ) |
Set dropdown parameters.
| dropdown_params | Dropdown parameter mapping |
| void nndeploy::dag::Node::setDynamicInput | ( | bool | is_dynamic_input | ) |
Set whether it's dynamic input.
| is_dynamic_input | Whether it's dynamic input |
| void nndeploy::dag::Node::setDynamicOutput | ( | bool | is_dynamic_output | ) |
Set whether it's dynamic output.
| is_dynamic_output | Whether it's dynamic output |
|
virtual |
Set external parameter.
| key | Parameter key |
| external_param | External parameter shared pointer |
Reimplemented in nndeploy::dag::Graph.
| base::Status nndeploy::dag::Node::setGraph | ( | Graph * | graph | ) |
| void nndeploy::dag::Node::setGraphFlag | ( | bool | flag | ) |
Set graph flag.
| flag | Flag value |
| void nndeploy::dag::Node::setInitializedFlag | ( | bool | flag | ) |
Set initialized flag.
| flag | Flag value |
| void nndeploy::dag::Node::setInnerFlag | ( | bool | flag | ) |
Set inner flag.
| flag | Flag value |
|
virtual |
Set input edge.
| input | Input edge pointer |
| index | Input edge index, default is -1 (auto assign) |
Reimplemented in nndeploy::dag::Graph, and nndeploy::dag::CompositeNode.
|
virtual |
Set input edge name.
| name | Input edge name |
| index | Input edge index, default is 0 |
Reimplemented in nndeploy::infer::Infer.
|
virtual |
Set all input edge names.
| names | Input edge name list |
Reimplemented in nndeploy::infer::Infer.
|
virtual |
Set all input edges.
| inputs | Input edge list |
Reimplemented in nndeploy::dag::Graph, and nndeploy::dag::CompositeNode.
|
virtual |
Set input edge (shared pointer)
| input | Input edge shared pointer |
| index | Input edge index, default is -1 (auto assign) |
Reimplemented in nndeploy::dag::Graph, and nndeploy::dag::CompositeNode.
|
virtual |
Set all input edges (shared pointer)
| inputs | Input edge shared pointer list |
Reimplemented in nndeploy::dag::Graph, and nndeploy::dag::CompositeNode.
| base::Status nndeploy::dag::Node::setInputTypeInfo | ( | std::shared_ptr< EdgeTypeInfo > | input_type_info, |
| std::string | desc = "" |
||
| ) |
Set input type information.
| input_type_info | Input type information shared pointer |
| desc | Description information, default is empty |
|
inline |
| base::Status nndeploy::dag::Node::setIoParams | ( | const std::vector< std::string > & | io_params | ) |
Set IO parameter list.
| io_params | IO parameter list |
| void nndeploy::dag::Node::setIoType | ( | IOType | io_type | ) |
Set IO type.
| io_type | IO type |
|
virtual |
Set iteration input edge.
| input | Input edge pointer |
| index | Input edge index, default is -1 (auto assign) |
Reimplemented in nndeploy::llm::LlmInfer, and nndeploy::llm::DefaultLlmInfer.
| void nndeploy::dag::Node::setKey | ( | const std::string & | key | ) |
Set node key.
| key | Node key |
|
virtual |
Set loop count.
| loop_count | Loop count |
Reimplemented in nndeploy::codec::Decode, and nndeploy::dag::Graph.
|
virtual |
Set memory buffer.
| buffer | Memory buffer pointer |
Reimplemented in nndeploy::infer::Infer.
| void nndeploy::dag::Node::setName | ( | const std::string & | name | ) |
Set node name.
| name | Node name |
| void nndeploy::dag::Node::setNodeType | ( | NodeType | node_type | ) |
Set node type.
| node_type | Node type |
|
virtual |
Set output edge.
| output | Output edge pointer |
| index | Output edge index, default is -1 (auto assign) |
Reimplemented in nndeploy::dag::Graph, and nndeploy::dag::CompositeNode.
|
inline |
|
virtual |
Set output edge name.
| name | Output edge name |
| index | Output edge index, default is 0 |
Reimplemented in nndeploy::infer::Infer.
|
virtual |
Set all output edge names.
| names | Output edge name list |
Reimplemented in nndeploy::infer::Infer.
|
virtual |
Set all output edges.
| outputs | Output edge list |
Reimplemented in nndeploy::dag::Graph, and nndeploy::dag::CompositeNode.
|
virtual |
Set output edge (shared pointer)
| output | Output edge shared pointer |
| index | Output edge index, default is -1 (auto assign) |
Reimplemented in nndeploy::dag::Graph, and nndeploy::dag::CompositeNode.
|
virtual |
Set all output edges (shared pointer)
| outputs | Output edge shared pointer list |
Reimplemented in nndeploy::dag::Graph, and nndeploy::dag::CompositeNode.
| base::Status nndeploy::dag::Node::setOutputTypeInfo | ( | std::shared_ptr< EdgeTypeInfo > | output_type_info, |
| std::string | desc = "" |
||
| ) |
Set output type information.
| output_type_info | Output type information shared pointer |
| desc | Description information, default is empty |
|
inline |
|
virtual |
Set parallel type.
| paralle_type | Parallel type |
|
virtual |
Set parameter.
| param | Parameter pointer |
Reimplemented in nndeploy::preprocess::BatchPreprocess, and nndeploy::infer::Infer.
|
virtual |
Set parameter (Any type)
| key | Parameter key |
| any | Any type parameter |
|
virtual |
Set parameter (string type)
| key | Parameter key |
| value | Parameter value |
|
virtual |
Set parameter (shared pointer)
| param | Parameter shared pointer |
Reimplemented in nndeploy::preprocess::BatchPreprocess, and nndeploy::infer::Infer.
| base::Status nndeploy::dag::Node::setRequiredParams | ( | const std::vector< std::string > & | required_params | ) |
Set required parameter list.
| required_params | Required parameter list |
|
inline |
| void nndeploy::dag::Node::setRunningFlag | ( | bool | flag | ) |
Set running flag.
| flag | Flag value |
| void nndeploy::dag::Node::setSource | ( | const std::string & | source | ) |
Set source information.
| source | Source information |
| void nndeploy::dag::Node::setStream | ( | device::Stream * | stream | ) |
Set compute stream.
| stream | Compute stream pointer |
| void nndeploy::dag::Node::setTimeProfileFlag | ( | bool | flag | ) |
Set time profile flag.
| flag | Flag value |
|
virtual |
| base::Status nndeploy::dag::Node::setUiParams | ( | const std::vector< std::string > & | ui_params | ) |
Set UI parameter list.
| ui_params | UI parameter list |
| base::Status nndeploy::dag::Node::setVersion | ( | const std::string & | version | ) |
Set version number.
| version | Version number |
|
virtual |
Synchronize execution.
Reimplemented in nndeploy::dag::Graph.
|
virtual |
|
virtual |
Update input.
Reimplemented in nndeploy::dag::ConstNode, nndeploy::qwen::PromptNode, nndeploy::llm::Prompt, and nndeploy::codec::Decode.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Node key.
Node key used for node registration and creation, full type name like nndeploy::dag::Node, must be specified in constructor
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |