13#include <tl/expected.hpp>
91 virtual std::string
inputName(
size_t idx = 0)
const = 0;
98 virtual std::string
outputName(
size_t idx = 0)
const = 0;
Defines error handling classes for the neural network module.
Contains the Tensor class for representing N-dimensional arrays with various data types.
Represents an error that occurred in the neural network module and contains the error type and messag...
Definition NeuralError.h:48
Abstract base class for neural networks.
Definition NeuralNet.h:31
virtual size_t inputCount() const =0
Get the number of inputs of the neural network.
virtual tl::expected< std::vector< Tensor >, NeuralError > infer(const Tensor &input)=0
Perform inference on the given input tensor.
virtual Shape outputShape(size_t idx=0) const =0
Get the output shape of the neural network. This might contain dynamic dimensions (e....
virtual std::string outputName(size_t idx=0) const =0
Get the name of the output tensor.
virtual int gpuId() const =0
Get the GPU ID used by the neural network if it is configured to use GPU.
virtual std::string inputName(size_t idx=0) const =0
Get the name of the input tensor.
virtual Shape inputShape(size_t idx=0) const =0
Get the input shape of the neural network. This might contain dynamic dimensions (e....
virtual size_t outputCount() const =0
Get the number of outputs of the neural network.
tl::expected< std::vector< Tensor >, NeuralError > operator()(const Tensor &input)
Call the infer method with the given input tensor.
Definition NeuralNet.h:56
A Tensor represents a N-dimensional array containing elements of the same type. Can be used as input ...
Definition Tensor.h:201
std::vector< int64_t > Shape
Shape of a N-dimensional Tensor represented as the size in each dimension. Can be -1 in case of dynam...
Definition Tensor.h:75
std::shared_ptr< NeuralNet > NeuralNetPtr
Smart pointer type for managing NeuralNet instances.
Definition NeuralNet.h:121
NN Neural Network Library containing Tensor and NeuralNet classes for inference.
Definition NeuralError.h:13