Class InferenceConfig¶
Note
Construct via the Class AniraWeb factory in most cases:
aniraWeb.InferenceConfig(...) rather than new InferenceConfig(...). The
factory threads the WASM instance through for you.
- class InferenceConfig(wasmInstance, modelDataVector, tensorShapeVector, processingSpec, maxInferenceTime, warmUp, sessionExclusiveProcessor, blockingRatio, numParallelProcessors)¶
TypeScript wrapper for anira::InferenceConfig Thread-safe C API wrapper
- Extends:
BaseWrapper
- Arguments:
wasmInstance (AniraWasmInstance)
modelDataVector (PossiblePointer<VectorModelData>)
tensorShapeVector (PossiblePointer<VectorTensorShape>)
processingSpec (PossiblePointer<ProcessingSpec>)
maxInferenceTime (number)
warmUp (number)
sessionExclusiveProcessor (boolean)
blockingRatio (number)
numParallelProcessors (number)
- destroy()¶
Free the underlying C++ object. See Lifecycle and Cleanup for when to call this.
- equals(other)¶
- Arguments:
other (PossiblePointer<InferenceConfig>)
- Returns:
boolean
- getBlockingRatio()¶
Mirrors the
anira::InferenceConfig::m_blocking_ratiofield.- Returns:
number
- getInternalModelLatency(tensorIndex=0)¶
Mirrors
anira::InferenceConfig::get_internal_model_latency().- Arguments:
tensorIndex (number)
- Returns:
number
- getMaxInferenceTime()¶
Mirrors the
anira::InferenceConfig::m_max_inference_timefield.- Returns:
number
- getModelData(backend)¶
Mirrors
anira::InferenceConfig::get_model_data().- Arguments:
backend (number)
- Returns:
number
- getModelPath(backend)¶
Mirrors
anira::InferenceConfig::get_model_path().- Arguments:
backend (number)
- Returns:
string
- getPostprocessOutputChannels(tensorIndex=0)¶
Mirrors
anira::InferenceConfig::get_postprocess_output_channels().- Arguments:
tensorIndex (number)
- Returns:
number
- getPostprocessOutputSize(tensorIndex=0)¶
Mirrors
anira::InferenceConfig::get_postprocess_output_size().- Arguments:
tensorIndex (number)
- Returns:
number
- getPreprocessInputChannels(tensorIndex=0)¶
Mirrors
anira::InferenceConfig::get_preprocess_input_channels().- Arguments:
tensorIndex (number)
- Returns:
number
- getPreprocessInputSize(tensorIndex=0)¶
Mirrors
anira::InferenceConfig::get_preprocess_input_size().- Arguments:
tensorIndex (number)
- Returns:
number
- getTensorInputShape(backend)¶
Mirrors
anira::InferenceConfig::get_tensor_input_shape().Returns a non-owning
TensorShapeListview into the config’s universal (or per-backend) input shape. Do not call.destroy()on it — the underlying storage belongs to theInferenceConfig.- Arguments:
backend (number)
- Returns:
TensorShapeList
- getTensorInputSize(tensorIndex=0)¶
Mirrors
anira::InferenceConfig::get_tensor_input_size().- Arguments:
tensorIndex (number)
- Returns:
number
- getTensorOutputShape(backend)¶
Mirrors
anira::InferenceConfig::get_tensor_output_shape().Returns a non-owning
TensorShapeListview. See getTensorInputShape for ownership notes.- Arguments:
backend (number)
- Returns:
TensorShapeList
- getTensorOutputSize(tensorIndex=0)¶
Mirrors
anira::InferenceConfig::get_tensor_output_size().- Arguments:
tensorIndex (number)
- Returns:
number
- getTensorShape(backend)¶
Mirrors
anira::InferenceConfig::get_tensor_shape().Returns a non-owning
TensorShapeview selected forbackend(falling back to the universal shape if no backend-specific shape is registered). Do not call.destroy()on it.- Arguments:
backend (number)
- Returns:
TensorShape
- getWarmUp()¶
Mirrors the
anira::InferenceConfig::m_warm_upfield.- Returns:
number
- isModelBinary(backend)¶
Mirrors
anira::InferenceConfig::is_model_binary().- Arguments:
backend (number)
- Returns:
boolean
- notEquals(other)¶
- Arguments:
other (PossiblePointer<InferenceConfig>)
- Returns:
boolean
- setBlockingRatio(value)¶
Mirrors the
anira::InferenceConfig::m_blocking_ratiofield.- Arguments:
value (number)
- setMaxInferenceTime(value)¶
Mirrors the
anira::InferenceConfig::m_max_inference_timefield.- Arguments:
value (number)
- setWarmUp(value)¶
Mirrors the
anira::InferenceConfig::m_warm_upfield.- Arguments:
value (number)