23#ifndef NV_ONNX_PARSER_H
24#define NV_ONNX_PARSER_H
36#define NV_ONNX_PARSER_MAJOR 0
37#define NV_ONNX_PARSER_MINOR 1
38#define NV_ONNX_PARSER_PATCH 0
102 virtual const char*
desc()
const = 0;
105 virtual const char*
file()
const = 0;
111 virtual const char*
func()
const = 0;
140 virtual bool parse(
void const* serialized_onnx_model,
141 size_t serialized_onnx_model_size,
142 const char* model_path =
nullptr)
168 size_t serialized_onnx_model_size,
170 const char* model_path =
nullptr)
183 void const* serialized_onnx_model,
size_t serialized_onnx_model_size)
#define TENSORRTAPI
Definition: NvInferRuntimeCommon.h:54
#define TRT_DEPRECATED
Definition: NvInferRuntimeCommon.h:40
std::vector< SubGraph_t > SubGraphCollection_t
The data structure containing all SubGraph_t partitioned out of an ONNX graph.
Definition: NvOnnxParser.h:54
#define NV_ONNX_PARSER_PATCH
Definition: NvOnnxParser.h:38
#define NV_ONNX_PARSER_MINOR
Definition: NvOnnxParser.h:37
TENSORRTAPI int getNvOnnxParserVersion()
std::pair< std::vector< size_t >, bool > SubGraph_t
The data structure containing the parsing capability of a set of nodes in an ONNX graph.
Definition: NvOnnxParser.h:47
#define NV_ONNX_PARSER_MAJOR
Definition: NvOnnxParser.h:36
TENSORRTAPI void * createNvOnnxParser_INTERNAL(void *network, void *logger, int version)
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntimeCommon.h:1476
A network definition for input to the builder.
Definition: NvInfer.h:6158
an object containing information about an error
Definition: NvOnnxParser.h:95
virtual int line() const =0
source line at which the error occurred
virtual ~IParserError()
Definition: NvOnnxParser.h:117
virtual ErrorCode code() const =0
the error code
virtual const char * file() const =0
source file in which the error occurred
virtual const char * desc() const =0
description of the error
virtual int node() const =0
index of the ONNX model node in which the error occurred
virtual const char * func() const =0
source function in which the error occurred
an object for parsing ONNX models into a TensorRT network definition
Definition: NvOnnxParser.h:125
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 insi...
virtual int getNbErrors() const =0
Get the number of errors that occurred during prior calls to parse.
virtual IParserError const * getError(int index) const =0
Get an error that occurred during prior calls to parse.
virtual ~IParser() noexcept=default
virtual void clearErrors()=0
Clear errors from prior calls to parse.
virtual TRT_DEPRECATED void destroy()=0
destroy this object
virtual bool supportsOperator(const char *op_name) const =0
Returns whether the specified operator may be supported by the parser.
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....
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. If the function returns True,...
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.
The TensorRT ONNX parser API namespace.
Definition: NvOnnxConfig.h:19
ErrorCode
the type of parser error
Definition: NvOnnxParser.h:72
@ kMODEL_DESERIALIZE_FAILED
int32_t EnumMax< ErrorCode >()
Definition: NvOnnxParser.h:85