|
LLVM 22.0.0git
|
MLModelRunner interface: abstraction of a mechanism for evaluating a ML model. More...
#include "llvm/Analysis/MLModelRunner.h"
Public Types | |
| enum class | Kind : int { Unknown , Release , Development , NoOp , Interactive } |
Public Member Functions | |
| MLModelRunner (const MLModelRunner &)=delete | |
| MLModelRunner & | operator= (const MLModelRunner &)=delete |
| virtual | ~MLModelRunner ()=default |
| template<typename T> | |
| T | evaluate () |
| template<typename T, typename I> | |
| T * | getTensor (I FeatureID) |
| template<typename T, typename I> | |
| const T * | getTensor (I FeatureID) const |
| void * | getTensorUntyped (size_t Index) |
| const void * | getTensorUntyped (size_t Index) const |
| Kind | getKind () const |
| virtual void | switchContext (StringRef Name) |
Protected Member Functions | |
| MLModelRunner (LLVMContext &Ctx, Kind Type, size_t NumInputs) | |
| virtual void * | evaluateUntyped ()=0 |
| void | setUpBufferForTensor (size_t Index, const TensorSpec &Spec, void *Buffer) |
Protected Attributes | |
| LLVMContext & | Ctx |
| const Kind | Type |
MLModelRunner interface: abstraction of a mechanism for evaluating a ML model.
More abstractly, evaluating a function that has as tensors as arguments, described via TensorSpecs, and returns a tensor. Currently, the latter is assumed to be a scalar, in absence of more elaborate scenarios. NOTE: feature indices are expected to be consistent all accross MLModelRunners (pertaining to the same model), and also Loggers (see TFUtils.h)
Definition at line 26 of file MLModelRunner.h.
|
strong |
| Enumerator | |
|---|---|
| Unknown | |
| Release | |
| Development | |
| NoOp | |
| Interactive | |
Definition at line 52 of file MLModelRunner.h.
|
delete |
References MLModelRunner().
Referenced by llvm::InteractiveModelRunner::classof(), llvm::NoInferenceModelRunner::classof(), llvm::ReleaseModeModelRunner< TGen >::classof(), getTensorUntyped(), llvm::InteractiveModelRunner::InteractiveModelRunner(), MLModelRunner(), llvm::NoInferenceModelRunner::NoInferenceModelRunner(), and operator=().
|
virtualdefault |
|
inlineprotected |
Definition at line 33 of file MLModelRunner.h.
References evaluateUntyped(), and T.
|
protectedpure virtual |
Referenced by evaluate().
|
inline |
Definition at line 53 of file MLModelRunner.h.
References Type.
Definition at line 37 of file MLModelRunner.h.
References getTensorUntyped(), I, and T.
Definition at line 42 of file MLModelRunner.h.
References getTensorUntyped(), I, and T.
|
inline |
Definition at line 47 of file MLModelRunner.h.
Referenced by getTensor(), and getTensor().
|
inline |
Definition at line 48 of file MLModelRunner.h.
References MLModelRunner().
|
delete |
References MLModelRunner().
|
inlineprotected |
Definition at line 63 of file MLModelRunner.h.
Referenced by llvm::InteractiveModelRunner::InteractiveModelRunner(), and llvm::NoInferenceModelRunner::NoInferenceModelRunner().
|
inlinevirtual |
Reimplemented in llvm::InteractiveModelRunner.
Definition at line 54 of file MLModelRunner.h.
|
protected |
Definition at line 72 of file MLModelRunner.h.
Referenced by llvm::InteractiveModelRunner::InteractiveModelRunner(), MLModelRunner(), llvm::NoInferenceModelRunner::NoInferenceModelRunner(), and llvm::ReleaseModeModelRunner< TGen >::ReleaseModeModelRunner().
Definition at line 73 of file MLModelRunner.h.
Referenced by getKind(), and MLModelRunner().