@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.
|
void |
destroy()
Deprecated.
|
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.
|
int |
getNbErrors()
\brief Get the number of errors that occurred during prior calls to
\p parse
|
PointerPointer |
getUsedVCPluginLibraries(long[] nbPluginLibs)
\brief Query the plugin libraries needed to implement operations used by the parser in a version-compatible
engine.
|
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) |
boolean |
supportsModel(Pointer serialized_onnx_model,
long serialized_onnx_model_size,
SubGraphCollection_t sub_graph_collection,
BytePointer model_path) |
boolean |
supportsModel(Pointer serialized_onnx_model,
long serialized_onnx_model_size,
SubGraphCollection_t sub_graph_collection,
String model_path)
\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") 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") public boolean parse(@Const Pointer serialized_onnx_model, @Cast(value="size_t") long serialized_onnx_model_size)
@Cast(value="bool") 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") public boolean parseFromFile(String onnxModelFile, int verbosity)
onnxModelFile
- nameverbosity
- Level@Cast(value="bool") public boolean parseFromFile(@Cast(value="const char*") BytePointer onnxModelFile, int verbosity)
@Cast(value="bool") 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") 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") 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") 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") public boolean supportsOperator(String op_name)
op_name
- The name of the ONNX operator to check for support@Cast(value="bool") public boolean supportsOperator(@Cast(value="const char*") BytePointer op_name)
@Deprecated public void destroy()
public int getNbErrors()
clearErrors() IParserError
@Const public IParserError getError(int index)
clearErrors() IParserError
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)
OnnxParserFlag
- 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()
Copyright © 2024. All rights reserved.