public final class OrtTensorRTProviderOptions extends OrtProviderOptions
Supported options are listed on the ORT website.
OrtProviderOptions.OrtProviderSupplier
Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
options
A Java side copy of the options.
|
closed, nativeHandle
Constructor and Description |
---|
OrtTensorRTProviderOptions()
Constructs TensorRT execution provider options for device 0.
|
OrtTensorRTProviderOptions(int deviceId)
Constructs TensorRT execution provider options for the specified non-negative device id.
|
Modifier and Type | Method and Description |
---|---|
void |
add(String key,
String value)
Adds a configuration option to this options.
|
protected void |
applyToNative()
Applies the Java side configuration to the native side object.
|
protected void |
applyToNative(long apiHandle,
long nativeHandle,
String[] keys,
String[] values)
Adds the options to this options instance.
|
protected void |
close(long apiHandle,
long nativeHandle)
Closes this options instance.
|
String |
getOptionsString()
Returns the serialized options string
|
OrtProvider |
getProvider()
Gets the provider enum for this options instance.
|
void |
parseOptionsString(String serializedForm)
Parses the output of
getOptionsString() and adds those options to this options
instance. |
String |
toString() |
checkClosed, close, getApiHandle, isClosed, loadLibraryAndCreate
public OrtTensorRTProviderOptions() throws OrtException
OrtException
- If TensorRT is unavailable.public OrtTensorRTProviderOptions(int deviceId) throws OrtException
deviceId
- The device id.OrtException
- If TensorRT is unavailable.public OrtProvider getProvider()
OrtProviderOptions
getProvider
in class OrtProviderOptions
protected void applyToNative(long apiHandle, long nativeHandle, String[] keys, String[] values) throws OrtException
apiHandle
- The api pointer.nativeHandle
- The native options pointer.keys
- The option keys.values
- The option values.OrtException
- If the addition failed.protected void close(long apiHandle, long nativeHandle)
close
in class OrtProviderOptions
apiHandle
- The api pointer.nativeHandle
- The native options pointer.public void add(String key, String value) throws OrtException
key
- The key.value
- The value.OrtException
- If the addition failed.public void parseOptionsString(String serializedForm) throws OrtException
getOptionsString()
and adds those options to this options
instance.serializedForm
- The serialized form to parse.OrtException
- If the option could not be added.public String getOptionsString()
protected void applyToNative() throws OrtException
OrtProviderOptions
applyToNative
in class OrtProviderOptions
OrtException
- If the native call failed.Copyright © 2024. All rights reserved.