HDK
|
#include <ML_Model.h>
Public Types | |
using | Shape = UT_Array< int64 > |
Public Member Functions | |
ML_Model () | |
~ML_Model () | |
bool | initializeModel (const UT_StringRef &model_filepath, bool usecuda, UT_WorkBuffer &errors, UT_WorkBuffer &warnings) |
bool | run (const UT_Array< UT_Array< float >> &inputs, const UT_Array< Shape > &input_shapes, UT_Array< UT_Array< float >> &outputs, const UT_Array< Shape > &output_shapes, UT_WorkBuffer &error_message) |
void | getNames (UT_StringArray &input_names, UT_StringArray &output_names) const |
void | getShapes (UT_Array< Shape > &input_shapes, UT_Array< Shape > &output_shapes) const |
Static Public Member Functions | |
static exint | tensorElementsSize (const UT_Array< exint > &tensor_dimensions, bool &has_dynamic_axes) |
static bool | mat3ToShape (Shape &tensor_shape, const UT_Matrix3D &shape_vector) |
static bool | parseOutputData (const UT_StringHolder &srcpattern, int maxtuplesize, UT_StringArray &names, UT_IntArray &sizes, UT_WorkBuffer &error) |
Definition at line 20 of file ML_Model.h.
using ML_Model::Shape = UT_Array<int64> |
Definition at line 28 of file ML_Model.h.
ML_Model::ML_Model | ( | ) |
ML_Model::~ML_Model | ( | ) |
void ML_Model::getNames | ( | UT_StringArray & | input_names, |
UT_StringArray & | output_names | ||
) | const |
void ML_Model::getShapes | ( | UT_Array< Shape > & | input_shapes, |
UT_Array< Shape > & | output_shapes | ||
) | const |
bool ML_Model::initializeModel | ( | const UT_StringRef & | model_filepath, |
bool | usecuda, | ||
UT_WorkBuffer & | errors, | ||
UT_WorkBuffer & | warnings | ||
) |
Initializer for the ML_Model class
model_filepath | contains the path to the ONNX model |
usecuda | will trigger if we add the cuda provider or not. |
errors | is meant to hold any error strings that may be generated from an error occurring during initialization |
|
static |
This is a function for acquiring the shape of a tensor from the parameters.
tensor_shape | the array to fill with the shape. |
|
static |
Parses the output data for nodes
maxtuplesize | -1 for unlimited |
bool ML_Model::run | ( | const UT_Array< UT_Array< float >> & | inputs, |
const UT_Array< Shape > & | input_shapes, | ||
UT_Array< UT_Array< float >> & | outputs, | ||
const UT_Array< Shape > & | output_shapes, | ||
UT_WorkBuffer & | error_message | ||
) |
|
static |
Gets the product of all non-dynamic axes of a tensor shape. Places a bool in a variable to determine if dynamic axes were found Any dimensions being zero will return 0