@Namespace(value="nvonnxparser") @Properties(inherit=nvonnxparser.class) public class IParser extends Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
IParser(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clearErrors()
\brief Clear errors from prior calls to \p parse
|
void |
clearFlag(int onnxParserFlag) |
void |
clearFlag(nvonnxparser.OnnxParserFlag onnxParserFlag)
\brief clear a parser flag.
|
IParserError |
getError(int index)
\brief Get an error that occurred during prior calls to \p parse
|
boolean |
getFlag(int onnxParserFlag) |
boolean |
getFlag(nvonnxparser.OnnxParserFlag onnxParserFlag)
\brief Returns true if the parser flag is set
|
int |
getFlags()
\brief Get the parser flags.
|
ITensor |
getLayerOutputTensor(BytePointer name,
long i) |
ITensor |
getLayerOutputTensor(String name,
long i)
\brief Return the i-th output ITensor object for the ONNX layer "name".
|
int |
getNbErrors()
\brief Get the number of errors that occurred during prior calls to
\p parse
|
long |
getNbSubgraphs()
\brief Get the number of subgraphs.
|
long[] |
getSubgraphNodes(long index,
long[] subgraphLength) |
LongBuffer |
getSubgraphNodes(long index,
LongBuffer subgraphLength) |
LongPointer |
getSubgraphNodes(long index,
LongPointer subgraphLength)
\brief Get the nodes of the specified subgraph.
|
PointerPointer |
getUsedVCPluginLibraries(long[] nbPluginLibs)
\brief Query the plugin libraries needed to implement operations used by the parser in a version-compatible
engine.
|
boolean |
isSubgraphSupported(long index)
\brief Returns whether the subgraph is supported.
|
boolean |
parse(Pointer serialized_onnx_model,
long serialized_onnx_model_size) |
boolean |
parse(Pointer serialized_onnx_model,
long serialized_onnx_model_size,
BytePointer model_path) |
boolean |
parse(Pointer serialized_onnx_model,
long serialized_onnx_model_size,
String model_path)
\brief Parse a serialized ONNX model into the TensorRT network.
|
boolean |
parseFromFile(BytePointer onnxModelFile,
int verbosity) |
boolean |
parseFromFile(String onnxModelFile,
int verbosity)
\brief Parse an onnx model file, which can be a binary protobuf or a text onnx model
calls parse method inside.
|
boolean |
parseWithWeightDescriptors(Pointer serialized_onnx_model,
long serialized_onnx_model_size)
\brief Parse a serialized ONNX model into the TensorRT network
with consideration of user provided weights
|
void |
setFlag(int onnxParserFlag) |
void |
setFlag(nvonnxparser.OnnxParserFlag onnxParserFlag)
\brief Set a single parser flag.
|
void |
setFlags(int onnxParserFlags)
\brief Set the parser flags.
|
boolean |
supportsModel(Pointer serialized_onnx_model,
long serialized_onnx_model_size,
SubGraphCollection_t sub_graph_collection)
Deprecated.
|
boolean |
supportsModel(Pointer serialized_onnx_model,
long serialized_onnx_model_size,
SubGraphCollection_t sub_graph_collection,
BytePointer model_path)
Deprecated.
|
boolean |
supportsModel(Pointer serialized_onnx_model,
long serialized_onnx_model_size,
SubGraphCollection_t sub_graph_collection,
String model_path)
Deprecated.
|
boolean |
supportsModelV2(Pointer serializedOnnxModel,
long serializedOnnxModelSize) |
boolean |
supportsModelV2(Pointer serializedOnnxModel,
long serializedOnnxModelSize,
BytePointer modelPath) |
boolean |
supportsModelV2(Pointer serializedOnnxModel,
long serializedOnnxModelSize,
String modelPath)
\brief Check whether TensorRT supports a particular ONNX model.
|
boolean |
supportsOperator(BytePointer op_name) |
boolean |
supportsOperator(String op_name)
\brief Returns whether the specified operator may be supported by the
parser.
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public IParser(Pointer p)
Pointer(Pointer)
.@Cast(value="bool") @NoException(value=true) public boolean parse(@Const Pointer serialized_onnx_model, @Cast(value="size_t") long serialized_onnx_model_size, String model_path)
serialized_onnx_model
- Pointer to the serialized ONNX modelserialized_onnx_model_size
- Size of the serialized ONNX model
in bytesmodel_path
- Absolute path to the model file for loading external weights if requiredgetError()
@Cast(value="bool") @NoException(value=true) public boolean parse(@Const Pointer serialized_onnx_model, @Cast(value="size_t") long serialized_onnx_model_size)
@Cast(value="bool") @NoException(value=true) public boolean parse(@Const Pointer serialized_onnx_model, @Cast(value="size_t") long serialized_onnx_model_size, @Cast(value="const char*") BytePointer model_path)
@Cast(value="bool") @NoException(value=true) public boolean parseFromFile(String onnxModelFile, int verbosity)
onnxModelFile
- nameverbosity
- Level@Cast(value="bool") @NoException(value=true) public boolean parseFromFile(@Cast(value="const char*") BytePointer onnxModelFile, int verbosity)
@Cast(value="bool") @Deprecated @NoException(value=true) public boolean supportsModel(@Const Pointer serialized_onnx_model, @Cast(value="size_t") long serialized_onnx_model_size, @ByRef SubGraphCollection_t sub_graph_collection, String model_path)
serialized_onnx_model
- Pointer to the serialized ONNX modelserialized_onnx_model_size
- Size of the serialized ONNX model
in bytessub_graph_collection
- Container to hold supported subgraphsmodel_path
- Absolute path to the model file for loading external weights if required@Cast(value="bool") @Deprecated @NoException(value=true) public boolean supportsModel(@Const Pointer serialized_onnx_model, @Cast(value="size_t") long serialized_onnx_model_size, @ByRef SubGraphCollection_t sub_graph_collection)
@Cast(value="bool") @Deprecated @NoException(value=true) public boolean supportsModel(@Const Pointer serialized_onnx_model, @Cast(value="size_t") long serialized_onnx_model_size, @ByRef SubGraphCollection_t sub_graph_collection, @Cast(value="const char*") BytePointer model_path)
@Cast(value="bool") @NoException(value=true) public boolean parseWithWeightDescriptors(@Const Pointer serialized_onnx_model, @Cast(value="size_t") long serialized_onnx_model_size)
serialized_onnx_model
- Pointer to the serialized ONNX modelserialized_onnx_model_size
- Size of the serialized ONNX model
in bytesgetError()
@Cast(value="bool") @NoException(value=true) public boolean supportsOperator(String op_name)
op_name
- The name of the ONNX operator to check for support@Cast(value="bool") @NoException(value=true) public boolean supportsOperator(@Cast(value="const char*") BytePointer op_name)
@NoException(value=true) public int getNbErrors()
clearErrors() IParserError
@Const @NoException(value=true) public IParserError getError(int index)
clearErrors() IParserError
@NoException(value=true) public void clearErrors()
getError() IParserError
@Cast(value="const char**") @NoException(value=true) public PointerPointer getUsedVCPluginLibraries(@Cast(value="int64_t*") @ByRef long[] nbPluginLibs)
nbPluginLibs
- [out] Returns the number of plugin libraries in the array, or -1 if there was an error.nbPluginLibs
C-strings describing plugin library paths on the filesystem if nbPluginLibs > 0,
or nullptr otherwise. This array is owned by the IParser, and the pointers in the array are only valid until
the next call to parse(), supportsModel(), parseFromFile(), or parseWithWeightDescriptors().@NoException(value=true) public void setFlags(@Cast(value="nvonnxparser::OnnxParserFlags") int onnxParserFlags)
OnnxParserFlags
- The flags used when parsing an ONNX model.
\note This function will override the previous set flags, rather than bitwise ORing the new flag.getFlags()
@Cast(value="nvonnxparser::OnnxParserFlags") @NoException(value=true) public int getFlags()
setFlags()
@NoException(value=true) public void clearFlag(nvonnxparser.OnnxParserFlag onnxParserFlag)
setFlags()
@NoException(value=true) public void clearFlag(@Cast(value="nvonnxparser::OnnxParserFlag") int onnxParserFlag)
@NoException(value=true) public void setFlag(nvonnxparser.OnnxParserFlag onnxParserFlag)
setFlags()
@NoException(value=true) public void setFlag(@Cast(value="nvonnxparser::OnnxParserFlag") int onnxParserFlag)
@Cast(value="bool") @NoException(value=true) public boolean getFlag(nvonnxparser.OnnxParserFlag onnxParserFlag)
getFlags()
@Cast(value="bool") @NoException(value=true) public boolean getFlag(@Cast(value="nvonnxparser::OnnxParserFlag") int onnxParserFlag)
@Const @NoException(value=true) public ITensor getLayerOutputTensor(String name, @Cast(value="int64_t") long i)
name
- The name of the ONNX layer.i
- The index of the output. i must be in range [0, layer.num_outputs).@Const @NoException(value=true) public ITensor getLayerOutputTensor(@Cast(value="const char*") BytePointer name, @Cast(value="int64_t") long i)
@Cast(value="bool") @NoException(value=true) public boolean supportsModelV2(@Const Pointer serializedOnnxModel, @Cast(value="size_t") long serializedOnnxModelSize, String modelPath)
serializedOnnxModel
- Pointer to the serialized ONNX modelserializedOnnxModelSize
- Size of the serialized ONNX model in bytesmodelPath
- Absolute path to the model file for loading external weights if required@Cast(value="bool") @NoException(value=true) public boolean supportsModelV2(@Const Pointer serializedOnnxModel, @Cast(value="size_t") long serializedOnnxModelSize)
@Cast(value="bool") @NoException(value=true) public boolean supportsModelV2(@Const Pointer serializedOnnxModel, @Cast(value="size_t") long serializedOnnxModelSize, @Cast(value="const char*") BytePointer modelPath)
@Cast(value="int64_t") @NoException(value=true) public long getNbSubgraphs()
@Cast(value="bool") @NoException(value=true) public boolean isSubgraphSupported(@Cast(value="const int64_t") long index)
index
- Index of the subgraph.@Cast(value="int64_t*") @NoException(value=true) public LongPointer getSubgraphNodes(@Cast(value="const int64_t") long index, @Cast(value="int64_t*") @ByRef LongPointer subgraphLength)
index
- Index of the subgraph.subgraphLength
- Returns the length of the subgraph as reference.@Cast(value="int64_t*") @NoException(value=true) public LongBuffer getSubgraphNodes(@Cast(value="const int64_t") long index, @Cast(value="int64_t*") @ByRef LongBuffer subgraphLength)
Copyright © 2025. All rights reserved.