an object for parsing ONNX models into a TensorRT network definition
More...
#include <NvOnnxParser.h>
|
virtual bool | parse (void const *serialized_onnx_model, size_t serialized_onnx_model_size, const char *model_path=nullptr)=0 |
| Parse a serialized ONNX model into the TensorRT network. This method has very limited diagnostics. If parsing the serialized model fails for any reason (e.g. unsupported IR version, unsupported opset, etc.) it the user responsibility to intercept and report the error. To obtain a better diagnostic, use the parseFromFile method below. More...
|
|
virtual bool | parseFromFile (const char *onnxModelFile, int verbosity)=0 |
| Parse an onnx model file, which can be a binary protobuf or a text onnx model calls parse method inside. More...
|
|
virtual bool | supportsModel (void const *serialized_onnx_model, size_t serialized_onnx_model_size, SubGraphCollection_t &sub_graph_collection, const char *model_path=nullptr)=0 |
| Check whether TensorRT supports a particular ONNX model. More...
|
|
virtual bool | parseWithWeightDescriptors (void const *serialized_onnx_model, size_t serialized_onnx_model_size)=0 |
| Parse a serialized ONNX model into the TensorRT network with consideration of user provided weights. More...
|
|
virtual bool | supportsOperator (const char *op_name) const =0 |
| Returns whether the specified operator may be supported by the parser. More...
|
|
virtual TRT_DEPRECATED void | destroy ()=0 |
| destroy this object More...
|
|
virtual int | getNbErrors () const =0 |
| Get the number of errors that occurred during prior calls to parse . More...
|
|
virtual IParserError const * | getError (int index) const =0 |
| Get an error that occurred during prior calls to parse . More...
|
|
virtual void | clearErrors ()=0 |
| Clear errors from prior calls to parse . More...
|
|
an object for parsing ONNX models into a TensorRT network definition
◆ clearErrors()
virtual void nvonnxparser::IParser::clearErrors |
( |
| ) |
|
|
pure virtual |
◆ destroy()
destroy this object
- Warning
- deprecated and planned on being removed in TensorRT 10.0
◆ getError()
virtual IParserError const * nvonnxparser::IParser::getError |
( |
int |
index | ) |
const |
|
pure virtual |
◆ getNbErrors()
virtual int nvonnxparser::IParser::getNbErrors |
( |
| ) |
const |
|
pure virtual |
◆ parse()
virtual bool nvonnxparser::IParser::parse |
( |
void const * |
serialized_onnx_model, |
|
|
size_t |
serialized_onnx_model_size, |
|
|
const char * |
model_path = nullptr |
|
) |
| |
|
pure virtual |
Parse a serialized ONNX model into the TensorRT network. This method has very limited diagnostics. If parsing the serialized model fails for any reason (e.g. unsupported IR version, unsupported opset, etc.) it the user responsibility to intercept and report the error. To obtain a better diagnostic, use the parseFromFile method below.
- Parameters
-
serialized_onnx_model | Pointer to the serialized ONNX model |
serialized_onnx_model_size | Size of the serialized ONNX model in bytes |
model_path | Absolute path to the model file for loading external weights if required |
- Returns
- true if the model was parsed successfully
- See also
- getNbErrors() getError()
◆ parseFromFile()
virtual bool nvonnxparser::IParser::parseFromFile |
( |
const char * |
onnxModelFile, |
|
|
int |
verbosity |
|
) |
| |
|
pure virtual |
Parse an onnx model file, which can be a binary protobuf or a text onnx model calls parse method inside.
- Parameters
-
- Returns
- true if the model was parsed successfully
◆ parseWithWeightDescriptors()
virtual bool nvonnxparser::IParser::parseWithWeightDescriptors |
( |
void const * |
serialized_onnx_model, |
|
|
size_t |
serialized_onnx_model_size |
|
) |
| |
|
pure virtual |
Parse a serialized ONNX model into the TensorRT network with consideration of user provided weights.
- Parameters
-
serialized_onnx_model | Pointer to the serialized ONNX model |
serialized_onnx_model_size | Size of the serialized ONNX model in bytes |
- Returns
- true if the model was parsed successfully
- See also
- getNbErrors() getError()
◆ supportsModel()
virtual bool nvonnxparser::IParser::supportsModel |
( |
void const * |
serialized_onnx_model, |
|
|
size_t |
serialized_onnx_model_size, |
|
|
SubGraphCollection_t & |
sub_graph_collection, |
|
|
const char * |
model_path = nullptr |
|
) |
| |
|
pure virtual |
Check whether TensorRT supports a particular ONNX model.
- Parameters
-
serialized_onnx_model | Pointer to the serialized ONNX model |
serialized_onnx_model_size | Size of the serialized ONNX model in bytes |
sub_graph_collection | Container to hold supported subgraphs |
model_path | Absolute path to the model file for loading external weights if required |
- Returns
- true if the model is supported
◆ supportsOperator()
virtual bool nvonnxparser::IParser::supportsOperator |
( |
const char * |
op_name | ) |
const |
|
pure virtual |
Returns whether the specified operator may be supported by the parser.
Note that a result of true does not guarantee that the operator will be supported in all cases (i.e., this function may return false-positives).
- Parameters
-
op_name | The name of the ONNX operator to check for support |
The documentation for this class was generated from the following file: