blace.ai
|
#include <types.h>
Public Member Functions | |
ml_core::BlaceHash | hash () |
bool | operator== (const ModelInferenceArgs &other) const |
bool | operator!= (const ModelInferenceArgs &other) const |
Public Attributes | |
DeviceEnum | device = DeviceEnum::CPU |
int | use_half = true |
int | seed = 0 |
int | run_threaded = false |
int | plot_inputs = false |
int | gpu_mem_opti = false |
int | empty_cache_after_inference = false |
int | experimental_torchscript_autocast = false |
Model inference arguments.
ml_core::BlaceHash blace::ml_core::ModelInferenceArgs::hash | ( | ) |
Hash the struct.
|
inline |
Simple inequality operator.
other | The other struct. |
bool blace::ml_core::ModelInferenceArgs::operator== | ( | const ModelInferenceArgs & | other | ) | const |
Simple equality operator.
other | The other struct. |
DeviceEnum blace::ml_core::ModelInferenceArgs::device = DeviceEnum::CPU |
The device to run the inference on.
int blace::ml_core::ModelInferenceArgs::empty_cache_after_inference = false |
Empty backend (cuda or metal) caches after every inference, might save some memory.
int blace::ml_core::ModelInferenceArgs::experimental_torchscript_autocast = false |
Run torchscript model in autocast mode.
int blace::ml_core::ModelInferenceArgs::gpu_mem_opti = false |
If several models are invoked in computation, unload all models to the cpu and have only current model on hardware accelerator.
int blace::ml_core::ModelInferenceArgs::plot_inputs = false |
Not used.
int blace::ml_core::ModelInferenceArgs::run_threaded = false |
Run inference in a seperate thread which can be cancelled (not available in beta).
int blace::ml_core::ModelInferenceArgs::seed = 0 |
A value to seed random operators with.
int blace::ml_core::ModelInferenceArgs::use_half = true |
Inference in half (fp16) precision if possible.