25 #ifndef NVNEURAL_ONNXTYPES_H
26 #define NVNEURAL_ONNXTYPES_H
Fundamental NvNeural data types are declared here.
@ Float
32-bit floating point elements (float)
NeuralResult
NeuralResult is a generic success/failure result type similar to COM HRESULT.
Definition: CoreTypes.h:275
OnnxTensorDataType
Enum class wrapping ONNX TensorProto.DataType.
Definition: OnnxTypes.h:36
@ Uint32
32-bit unsigned integer (uint32_t, unsigned int)
@ Uint16
16-bit unsigned integer (uint16_t)
@ Int16
16-bit signed integer (int16_t)
@ Uint8
8-bit unsigned integer (uint8_t)
@ Int8
8-bit signed integer (int8_t)
@ Int32
32-bit signed integer (int32_t, int)
@ Uint64
64-bit unsigned integer (uint64_t, unsigned long long, size_t)
@ Double
64-bit floating point (double)
@ Complex64
Pair of 32-bit floating point values representing real/imaginary.
@ Complex128
Pair of 64-bit floating point values representing real/imaginary.
@ Int64
64-bit signed integer (int64_t, long long)
@ Bfloat16
Non-IEEE 16-bit floating-point (1 sign, 8 exponent, 7 mantissa)
Float16 is a CPU-side implementation of half-precision floating point (aka FP16).
Definition: CoreTypes.h:201
ILayer is the base class for neural network layers.
Definition: LayerTypes.h:59
ONNX export interface for IActivationFunction.
Definition: OnnxTypes.h:380
virtual NeuralResult generateActivationOnnx(IOnnxGenerationHost *pOnnxHost, const ILayer *pLayer) const noexcept=0
Generates ONNX operators for this activation function.
Tool-provided interface representing an AttributeProto in an ONNX graph node.
Definition: OnnxTypes.h:58
virtual NeuralResult assignInteger(std::int64_t value) noexcept=0
Assigns a scalar value of type INT.
virtual NeuralResult pushInteger(int64_t value) noexcept=0
Appends to a vector of type INTS.
virtual NeuralResult assignBytes(const char *pBuffer, size_t bufferBytes) noexcept=0
Assigns a scalar value of type STRING.
virtual NeuralResult setDocString(const char *pDocString) noexcept=0
Assigns a human-readable documentation string to the node.
static const IRefObject::TypeId typeID
Interface TypeId for InterfaceOf purposes.
Definition: OnnxTypes.h:61
virtual NeuralResult assignString(const char *pBuffer) noexcept=0
Assigns a scalar value of type STRING.
virtual NeuralResult pushString(const char *pBuffer) noexcept=0
Appends to a vector of type STRINGS.
virtual NeuralResult assignFloat(float value) noexcept=0
Assigns a scalar value of type FLOAT.
virtual NeuralResult pushString(const char *pBuffer, size_t bufferBytes) noexcept=0
Appends to a vector of type STRINGS.
virtual NeuralResult pushFloat(float value) noexcept=0
Appends to a vector of type FLOATS.
virtual NeuralResult setName(const char *pName) noexcept=0
Sets the name of this attribute.
Tool-provided interface representing a NodeProto in an ONNX graph.
Definition: OnnxTypes.h:141
virtual NeuralResult setDocString(const char *pDocString) noexcept=0
Assigns a human-readable documentation string to the node.
virtual NeuralResult setName(const char *pName) noexcept=0
Sets the name of the node.
virtual NeuralResult setOperatorSetDomain(const char *pDomain) noexcept=0
Sets the operator set domain used by this node.
virtual NeuralResult createAttribute(IOnnxGenerationGraphAttribute **ppAttrOut) noexcept=0
Creates a new attribute for this node and returns it.
static const IRefObject::TypeId typeID
Interface TypeId for InterfaceOf purposes.
Definition: OnnxTypes.h:144
virtual NeuralResult setOperatorType(const char *pOpType) noexcept=0
Sets the operator type of the node.
virtual NeuralResult addInput(const char *pName) noexcept=0
Adds an input reference to the node.
virtual NeuralResult addOutput(const char *pName) noexcept=0
Adds an output reference to the node.
Tool-provided interface for creating ONNX model graphs in an ABI-stable fashion.
Definition: OnnxTypes.h:199
virtual NeuralResult setLayerOutputName(const ILayer *pLayer, const char *pOutputName) noexcept=0
Sets the "output name" associated with a layer.
virtual bool automaticFp16ConversionEnabled() const noexcept=0
Returns true if automatic fp16 conversion is enabled.
virtual NeuralResult addGraphOutput(const char *pOutputName, bool fp16Eligible, TensorDimension tensorDim) noexcept=0
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual NeuralResult addGraphOutput(const char *pOutputName, bool fp16Eligible) noexcept=0
Adds a new graph output.
virtual NeuralResult addGraphInitializer(const char *pInitializerName, OnnxTensorDataType dataType, bool fp16Eligible, TensorDimension tensorSize, const void *pTensorData, std::size_t tensorDataBytes) noexcept=0
Adds a tensor as a named graph initializer.
virtual NeuralResult addGraphInput(const char *pInputName, bool fp16Eligible) noexcept=0
Adds a new graph input.
virtual NeuralResult importOperatorSet(const char *pDomain, std::int64_t version) noexcept=0
Adds a versioned operator set to the graph's import list.
virtual NeuralResult addWeightsConstant(const char *pInitializerName, const IWeightsData *pWeightsData, bool fp16Eligible) noexcept=0
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual NeuralResult addWeightsConstant(const char *pInitializerName, const IWeightsData *pWeightsData, bool fp16Eligible, const std::int64_t *pTensorDims, std::size_t numTensorDims) noexcept=0
Adds weights data as a named graph initializer.
virtual NeuralResult createGraphNode(IOnnxGenerationGraphNode **ppNodeOut) noexcept=0
Creates a new graph node (GraphProto.node) and returns a pointer to it.
static const IRefObject::TypeId typeID
Interface TypeId for InterfaceOf purposes.
Definition: OnnxTypes.h:202
virtual NeuralResult addGraphInput(const char *pInputName, bool fp16Eligible, TensorDimension tensorDim) noexcept=0
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual const char * getLayerOutputName(const ILayer *pLayer) const noexcept=0
Returns the "output name" associated with a layer.
virtual NeuralResult addGraphInitializer(const char *pInitializerName, OnnxTensorDataType dataType, bool fp16Eligible, const std::int64_t *pTensorDims, std::size_t numTensorDims, const void *pTensorData, std::size_t tensorDataBytes) noexcept=0
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual bool shouldUseExplicitTensorSizes() const noexcept=0
Returns true if graph inputs and outputs should be sized explicitly.
virtual bool placeholdersEnabled() const noexcept=0
Returns true if placeholder operators are permitted.
ONNX export interface for ILayer.
Definition: OnnxTypes.h:354
virtual NeuralResult generateLayerOnnx(IOnnxGenerationHost *pOnnxHost) const noexcept=0
Generates ONNX operators for this layer.
Base class for all objects, similar to COM's IUnknown.
Definition: CoreTypes.h:343
std::uint64_t TypeId
Every interface must define a unique TypeId. This should be randomized.
Definition: CoreTypes.h:349
IWeightsData represents a binary buffer provided by IWeightsLoader.
Definition: CoreTypes.h:494
TensorDimension describes the dimensions of a four-dimensional image tensor.
Definition: CoreTypes.h:136