Skip to main content

Semantic Struct

Discriminated union of "what this tensor represents". More...

Declaration

struct simaai::neat::Semantic { ... }

Included Headers

#include <TensorCore.h>

Public Member Attributes Index

std::optional< ImageSpec >image

Set for image tensors. More...

std::optional< AudioSpec >audio

Set for audio tensors. More...

std::optional< TokensSpec >tokens

Set for token-stream tensors (NLP). More...

std::optional< TextSpec >text

Set for UTF-8 text tensors. More...

std::optional< ByteStreamSpec >byte_stream

Set for opaque raw-byte tensors. More...

std::optional< TessSpec >tess

Set for tessellated tile-layout tensors. More...

std::optional< EncodedSpec >encoded

Set for encoded-stream tensors (H.264, etc.). More...

std::optional< QuantSpec >quant

Set for quantized integer tensors. More...

std::optional< PreprocessRuntimeMeta >preprocess

Set when the tensor was produced by a preprocess stage. More...

Description

Discriminated union of "what this tensor represents".

A single tensor can be image data, audio, tokens, an opaque byte stream, a tessellated tile, an encoded video frame, a quantization payload, or a preprocessing residue — and sometimes more than one at once (e.g., quantized image data). Each spec is an std::optional; only the relevant ones are set. Consumers query the optional that matters to them.

 if (tensor.semantic.image.has_value()) {
  auto fmt = tensor.semantic.image->format;
  // ...
 }

Definition at line 322 of file TensorCore.h.

Public Member Attributes

audio

std::optional<AudioSpec> simaai::neat::Semantic::audio

Set for audio tensors.

Definition at line 324 of file TensorCore.h.

324 std::optional<AudioSpec> audio;

byte_stream

std::optional<ByteStreamSpec> simaai::neat::Semantic::byte_stream

Set for opaque raw-byte tensors.

Definition at line 327 of file TensorCore.h.

327 std::optional<ByteStreamSpec> byte_stream;

encoded

std::optional<EncodedSpec> simaai::neat::Semantic::encoded

Set for encoded-stream tensors (H.264, etc.).

Definition at line 329 of file TensorCore.h.

329 std::optional<EncodedSpec> encoded;

image

std::optional<ImageSpec> simaai::neat::Semantic::image

Set for image tensors.

Definition at line 323 of file TensorCore.h.

323 std::optional<ImageSpec> image;

preprocess

std::optional<PreprocessRuntimeMeta> simaai::neat::Semantic::preprocess

Set when the tensor was produced by a preprocess stage.

Definition at line 332 of file TensorCore.h.

quant

std::optional<QuantSpec> simaai::neat::Semantic::quant

Set for quantized integer tensors.

Definition at line 330 of file TensorCore.h.

330 std::optional<QuantSpec> quant;

tess

std::optional<TessSpec> simaai::neat::Semantic::tess

Set for tessellated tile-layout tensors.

Definition at line 328 of file TensorCore.h.

328 std::optional<TessSpec> tess;

text

std::optional<TextSpec> simaai::neat::Semantic::text

Set for UTF-8 text tensors.

Definition at line 326 of file TensorCore.h.

326 std::optional<TextSpec> text;

tokens

std::optional<TokensSpec> simaai::neat::Semantic::tokens

Set for token-stream tensors (NLP).

Definition at line 325 of file TensorCore.h.

325 std::optional<TokensSpec> tokens;

The documentation for this struct was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.