18#ifndef vtkONNXInference_h
19#define vtkONNXInference_h
21#include "vtkFiltersONNXModule.h"
27VTK_ABI_NAMESPACE_BEGIN
31class AllocatorWithDefaultOptions;
48 vtkGetMacro(ModelFile, std::string);
82 vtkGetMacro(InputSize,
int);
95 vtkSetMacro(TimeStepIndex,
int);
96 vtkGetMacro(TimeStepIndex,
int);
103 vtkSetMacro(OutputDimension,
int);
104 vtkGetMacro(OutputDimension,
int);
112 vtkSetMacro(OnCellData,
bool);
113 vtkGetMacro(OnCellData,
bool);
135 void InitializeSession();
141 std::vector<Ort::Value> RunModel(Ort::Value& inputTensor);
144 std::string ModelFile;
145 int64_t InputSize = 0;
146 std::vector<float> InputParameters;
147 std::vector<double> TimeStepValues;
148 int TimeStepIndex = -1;
151 int OutputDimension = 1;
152 bool OnCellData =
true;
154 bool Initialized =
false;
155 std::unique_ptr<vtkONNXInferenceInternals> Internals;
a simple class to control print indentation
void ClearInputParameters()
Clear the input parameters vector.
void ClearTimeStepValues()
Clear the time step values vector.
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is required to inform the pipeline of the time steps.
~vtkONNXInference() override=default
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void SetInputParameter(vtkIdType idx, float InputParameter)
Set an input parameter at a given index.
static vtkONNXInference * New()
void SetTimeStepValue(vtkIdType idx, double timeStepValue)
Set a time value at a given index.
void SetModelFile(const std::string &file)
Get/Set the path to the ONNX model and load it.
void SetNumberOfInputParameters(vtkIdType nb)
Set the number of input parameters.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetNumberOfTimeStepValues(vtkIdType nb)
Set the number of time step values.
Superclass for algorithms that produce only unstructured grid as output.
VTK internal class for hiding ONNX members.