23 #ifndef vtkONNXInference_h
24 #define vtkONNXInference_h
26 #include "vtkFiltersONNXModule.h"
34 VTK_ABI_NAMESPACE_BEGIN
38 class AllocatorWithDefaultOptions;
71 void SetTimeStepValues(
const std::vector<double>& times);
76 void SetTimeStepValue(
vtkIdType idx,
double timeStepValue);
82 void SetNumberOfTimeStepValues(
vtkIdType nb);
88 void ClearTimeStepValues();
95 vtkSetMacro(TimeStepIndex,
int);
96 vtkGetMacro(TimeStepIndex,
int);
110 void SetInputParameters(
const std::vector<float>& params);
116 void SetInputParameter(
vtkIdType idx,
float InputParameter);
122 void ClearInputParameters();
130 void SetInputShape(
const std::vector<int64_t>& shape);
131 void SetInputShape(
vtkIdType idx,
int shapeElement);
133 const std::vector<int64_t>& GetInputShape()
const;
140 void SetNumberOfInputShapeElements(
vtkIdType nb);
146 void ClearInputShape();
157 void SetInputPermutation(
const std::vector<int>& shape);
158 const std::vector<int>& GetInputPermutation()
const;
170 void SetOutputPermutation(
const std::vector<int>& permutation);
171 const std::vector<int>& GetOutputPermutation()
const;
179 vtkSetMacro(FieldArrayInput,
bool);
180 vtkGetMacro(FieldArrayInput,
bool);
181 vtkBooleanMacro(FieldArrayInput,
bool);
188 vtkSetMacro(ProcessedFieldArrayName,
const std::string&);
189 vtkGetMacro(ProcessedFieldArrayName,
const std::string&);
196 vtkSetMacro(OutputDimension,
int);
197 vtkGetMacro(OutputDimension,
int);
205 vtkSetMacro(ArrayAssociation,
int);
206 vtkGetMacro(ArrayAssociation,
int);
234 void InitializeSession();
241 bool ShouldGenerateTimeSteps();
247 bool GenerateInputTensorFromParameters(
248 std::vector<float>& parameters, Ort::Value& inputTensor,
double timeValue);
254 bool GenerateInputTensorFromFieldArray(
261 std::vector<Ort::Value> RunModel(Ort::Value& inputTensor);
265 std::vector<int64_t> InputShape = { 0 };
266 std::vector<float> InputParameters;
267 std::vector<double> TimeStepValues;
268 int TimeStepIndex = -1;
269 bool FieldArrayInput =
false;
271 std::vector<int> InputPermutation;
274 int OutputDimension = 1;
275 std::vector<int> OutputPermutation;
278 std::vector<float> InputDataBuffer;
280 bool Initialized =
false;
281 std::unique_ptr<vtkONNXInferenceInternals> Internals;
283 VTK_ABI_NAMESPACE_END
285 #endif // vtkONNXInference_h
a simple class to control print indentation
represent and manipulate attribute data in a dataset
VTK internal class for hiding ONNX members.
general representation of visualization data