![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <NNERuntimeRunSync.h>
Inheritance diagram for UE::NNE::IModelInstanceRunSync:Public Types | |
| using | ESetInputTensorShapesStatus = EResultStatus |
| using | ERunSyncStatus = EResultStatus |
Public Member Functions | |
| virtual | ~IModelInstanceRunSync ()=default |
| virtual TConstArrayView< FTensorDesc > | GetInputTensorDescs () const =0 |
| virtual TConstArrayView< FTensorDesc > | GetOutputTensorDescs () const =0 |
| virtual TConstArrayView< FTensorShape > | GetInputTensorShapes () const =0 |
| virtual TConstArrayView< FTensorShape > | GetOutputTensorShapes () const =0 |
| virtual ESetInputTensorShapesStatus | SetInputTensorShapes (TConstArrayView< FTensorShape > InInputShapes)=0 |
| virtual ERunSyncStatus | RunSync (TConstArrayView< FTensorBindingCPU > InInputTensors, TConstArrayView< FTensorBindingCPU > InOutputTensors)=0 |
The interface of a model instance that can run synchronously from CPU memory.
Use UE::NNE::IModelXXX::CreateModelInstance() to get a model instance. Use UE::NNE::GetRuntime<INNERuntimeXXX>(RuntimeName) to get a runtime capable of creating models.
|
virtualdefault |
|
pure virtual |
Get the input tensor descriptions as defined by the model, potentially with variable dimensions.
|
pure virtual |
Get the input shapes.
SetInputTensorShapes must be called prior of running a model.
|
pure virtual |
Get the output tensor descriptions as defined by the model, potentially with variable dimensions.
|
pure virtual |
Getters for outputs shapes if they were already resolved.
Output shapes might be resolved after a call to SetInputTensorShapes if the model and runtime supports it. Otherwise they will be resolved while running the model
|
pure virtual |
Evaluate the model synchronously.
SetInputTensorShapes must be called prior to this call. This function will block the calling thread until the inference is complete. The caller owns the memory inside the bindings and must make sure that they are big enough. Clients can call this function from an async task but must make sure the memory remains valid throughout the evaluation.
| InInputTensors | An array containing tensor bindings for each input tensor with caller owned memory containing the input data. |
| InOutputTensors | An array containing tensor bindings for each output tensor with caller owned memory big enough to contain the results on success. |
|
pure virtual |
Prepare the model to be run with the given input shape.
The call is mandatory before a model can be run. The function will run shape inference and resolve, if possible, the output shapes which can then be accessed by calling GetOutputTensorShapes(). This is a potentially expensive call and should be called lazily if possible.
| InInputShapes | The input shapes to prepare the model with. |