@Namespace(value="nvinfer1") @NoOffset @Properties(inherit=nvinfer.class) public class IRefitter extends INoCopy
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
IRefitter()
Default native constructor.
|
IRefitter(long size)
Native array allocator.
|
IRefitter(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Deprecated.
Deprecated in TRT 8.0. Superseded by
delete .
\warning Calling destroy on a managed pointer will result in a double-free error. |
int |
getAll(int size,
byte[] layerNames,
int[] roles) |
int |
getAll(int size,
ByteBuffer layerNames,
IntBuffer roles) |
int |
getAll(int size,
BytePointer layerNames,
IntPointer roles) |
int |
getAll(int size,
PointerPointer layerNames,
IntPointer roles)
\brief Get description of all weights that could be refit.
|
int |
getAllWeights(int size,
byte[] weightsNames) |
int |
getAllWeights(int size,
ByteBuffer weightsNames) |
int |
getAllWeights(int size,
BytePointer weightsNames) |
int |
getAllWeights(int size,
PointerPointer weightsNames)
\brief Get names of all weights that could be refit.
|
float |
getDynamicRangeMax(BytePointer tensorName) |
float |
getDynamicRangeMax(String tensorName)
\brief Get maximum of dynamic range.
|
float |
getDynamicRangeMin(BytePointer tensorName) |
float |
getDynamicRangeMin(String tensorName)
\brief Get minimum of dynamic range.
|
IErrorRecorder |
getErrorRecorder()
\brief Get the ErrorRecorder assigned to this interface.
|
ILogger |
getLogger()
\brief get the logger with which the refitter was created
|
int |
getMaxThreads()
\brief get the maximum number of threads that can be used by the refitter.
|
int |
getMissing(int size,
byte[] layerNames,
int[] roles) |
int |
getMissing(int size,
ByteBuffer layerNames,
IntBuffer roles) |
int |
getMissing(int size,
BytePointer layerNames,
IntPointer roles) |
int |
getMissing(int size,
PointerPointer layerNames,
IntPointer roles)
\brief Get description of missing weights.
|
int |
getMissingWeights(int size,
byte[] weightsNames) |
int |
getMissingWeights(int size,
ByteBuffer weightsNames) |
int |
getMissingWeights(int size,
BytePointer weightsNames) |
int |
getMissingWeights(int size,
PointerPointer weightsNames)
\brief Get names of missing weights.
|
IRefitter |
getPointer(long i) |
int |
getTensorsWithDynamicRange(int size,
byte[] tensorNames) |
int |
getTensorsWithDynamicRange(int size,
ByteBuffer tensorNames) |
int |
getTensorsWithDynamicRange(int size,
BytePointer tensorNames) |
int |
getTensorsWithDynamicRange(int size,
PointerPointer tensorNames)
\brief Get names of all tensors that have refittable dynamic ranges.
|
IRefitter |
position(long position) |
boolean |
refitCudaEngine()
\brief Updates associated engine.
|
boolean |
setDynamicRange(BytePointer tensorName,
float min,
float max) |
boolean |
setDynamicRange(String tensorName,
float min,
float max)
Update dynamic range for a tensor.
|
void |
setErrorRecorder(IErrorRecorder recorder) |
boolean |
setMaxThreads(int maxThreads)
\brief Set the maximum number of threads.
|
boolean |
setNamedWeights(BytePointer name,
Weights weights) |
boolean |
setNamedWeights(String name,
Weights weights)
\brief Specify new weights of given name.
|
boolean |
setWeights(BytePointer layerName,
int role,
Weights weights) |
boolean |
setWeights(String layerName,
nvinfer.WeightsRole role,
Weights weights)
\brief Specify new weights for a layer of given name.
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public IRefitter()
public IRefitter(long size)
Pointer.position(long)
.public IRefitter(Pointer p)
Pointer(Pointer)
.public IRefitter getPointer(long i)
getPointer
in class Pointer
@Cast(value="bool") @NoException(value=true) public boolean setWeights(String layerName, nvinfer.WeightsRole role, @ByVal Weights weights)
@Cast(value="bool") @NoException(value=true) public boolean setWeights(@Cast(value="const char*") BytePointer layerName, @Cast(value="nvinfer1::WeightsRole") int role, @ByVal Weights weights)
@Cast(value="bool") @NoException(value=true) public boolean refitCudaEngine()
@NoException(value=true) public int getMissing(int size, @Cast(value="const char**") PointerPointer layerNames, @Cast(value="nvinfer1::WeightsRole*") IntPointer roles)
size
- The number of items that can be safely written to a non-null layerNames or roles.layerNames
- Where to write the layer names.roles
- Where to write the weights roles.@NoException(value=true) public int getMissing(int size, @Cast(value="const char**") @ByPtrPtr BytePointer layerNames, @Cast(value="nvinfer1::WeightsRole*") IntPointer roles)
@NoException(value=true) public int getMissing(int size, @Cast(value="const char**") @ByPtrPtr ByteBuffer layerNames, @Cast(value="nvinfer1::WeightsRole*") IntBuffer roles)
@NoException(value=true) public int getMissing(int size, @Cast(value="const char**") @ByPtrPtr byte[] layerNames, @Cast(value="nvinfer1::WeightsRole*") int[] roles)
@NoException(value=true) public int getAll(int size, @Cast(value="const char**") PointerPointer layerNames, @Cast(value="nvinfer1::WeightsRole*") IntPointer roles)
size
- The number of items that can be safely written to a non-null layerNames or roles.layerNames
- Where to write the layer names.roles
- Where to write the weights roles.@NoException(value=true) public int getAll(int size, @Cast(value="const char**") @ByPtrPtr BytePointer layerNames, @Cast(value="nvinfer1::WeightsRole*") IntPointer roles)
@NoException(value=true) public int getAll(int size, @Cast(value="const char**") @ByPtrPtr ByteBuffer layerNames, @Cast(value="nvinfer1::WeightsRole*") IntBuffer roles)
@NoException(value=true) public int getAll(int size, @Cast(value="const char**") @ByPtrPtr byte[] layerNames, @Cast(value="nvinfer1::WeightsRole*") int[] roles)
@Deprecated @NoException(value=true) public void destroy()
delete
.
\warning Calling destroy on a managed pointer will result in a double-free error.@Cast(value="bool") @NoException(value=true) public boolean setDynamicRange(String tensorName, float min, float max)
tensorName
- The name of an ITensor in the network.min
- The minimum of the dynamic range for the tensor.max
- The maximum of the dynamic range for the tensor.@Cast(value="bool") @NoException(value=true) public boolean setDynamicRange(@Cast(value="const char*") BytePointer tensorName, float min, float max)
@NoException(value=true) public float getDynamicRangeMin(String tensorName)
@NoException(value=true) public float getDynamicRangeMin(@Cast(value="const char*") BytePointer tensorName)
@NoException(value=true) public float getDynamicRangeMax(String tensorName)
@NoException(value=true) public float getDynamicRangeMax(@Cast(value="const char*") BytePointer tensorName)
@NoException(value=true) public int getTensorsWithDynamicRange(int size, @Cast(value="const char**") PointerPointer tensorNames)
size
- The number of items that can be safely written to a non-null tensorNames.tensorNames
- Where to write the layer names.@NoException(value=true) public int getTensorsWithDynamicRange(int size, @Cast(value="const char**") @ByPtrPtr BytePointer tensorNames)
@NoException(value=true) public int getTensorsWithDynamicRange(int size, @Cast(value="const char**") @ByPtrPtr ByteBuffer tensorNames)
@NoException(value=true) public int getTensorsWithDynamicRange(int size, @Cast(value="const char**") @ByPtrPtr byte[] tensorNames)
@NoException(value=true) public void setErrorRecorder(IErrorRecorder recorder)
/**
@NoException(value=true) public IErrorRecorder getErrorRecorder()
setErrorRecorder()
@Cast(value="bool") @NoException(value=true) public boolean setNamedWeights(String name, @ByVal Weights weights)
name
- The name of the weights to be refit.weights
- The new weights to associate with the name.
Returns true on success, or false if new weights are rejected.
Possible reasons for rejection are:
* The name of weights is nullptr or does not correspond to any refittable weights.
* The number of weights is inconsistent with the original specification.
Modifying the weights before method refitCudaEngine() completes will result in undefined behavior.
\warning The string name must be null-terminated, and be at most 4096 bytes including the terminator.@Cast(value="bool") @NoException(value=true) public boolean setNamedWeights(@Cast(value="const char*") BytePointer name, @ByVal Weights weights)
@NoException(value=true) public int getMissingWeights(int size, @Cast(value="const char**") PointerPointer weightsNames)
size
- The number of weights names that can be safely written to.weightsNames
- The names of the weights to be updated, or nullptr for unnamed weights.@NoException(value=true) public int getMissingWeights(int size, @Cast(value="const char**") @ByPtrPtr BytePointer weightsNames)
@NoException(value=true) public int getMissingWeights(int size, @Cast(value="const char**") @ByPtrPtr ByteBuffer weightsNames)
@NoException(value=true) public int getMissingWeights(int size, @Cast(value="const char**") @ByPtrPtr byte[] weightsNames)
@NoException(value=true) public int getAllWeights(int size, @Cast(value="const char**") PointerPointer weightsNames)
size
- The number of weights names that can be safely written to.weightsNames
- The names of the weights to be updated, or nullptr for unnamed weights.@NoException(value=true) public int getAllWeights(int size, @Cast(value="const char**") @ByPtrPtr BytePointer weightsNames)
@NoException(value=true) public int getAllWeights(int size, @Cast(value="const char**") @ByPtrPtr ByteBuffer weightsNames)
@NoException(value=true) public int getAllWeights(int size, @Cast(value="const char**") @ByPtrPtr byte[] weightsNames)
@NoException(value=true) public ILogger getLogger()
@Cast(value="bool") @NoException(value=true) public boolean setMaxThreads(int maxThreads)
maxThreads
- The maximum number of threads that can be used by the refitter.@NoException(value=true) public int getMaxThreads()
setMaxThreads()
Copyright © 2024. All rights reserved.