ModalitySample<T>
Models & Types · AiDotNet.Data.Multimodal
Represents a single modality’s data within a multimodal sample.
For Beginners
Think of this as a labeled container. It holds data (a tensor) plus a tag saying what kind of data it is (image, text, etc.).
How It Works
Each ModalitySample wraps a tensor of data along with metadata about what modality it represents and an optional key for identification.
Constructors
| Constructor | Summary |
|---|---|
ModalitySample(ModalityType modality, Tensor<T> data, string key, IReadOnlyDictionary<string, object> metadata) |
Creates a new modality sample. |
Properties
| Property | Summary |
|---|---|
IReadOnlyDictionary<string, object> Metadata { get; } |
Gets optional metadata associated with this modality sample. |
ModalityType Modality { get; } |
Gets the modality type of this sample. |
Tensor<T> Data { get; } |
Gets the data tensor for this modality. |
int ElementCount { get; } |
Gets the total number of elements in the data tensor. |
int[] Shape { get; } |
Gets the shape of the data tensor. |
string Key { get; } |
Gets an optional key to identify this modality within a multimodal sample. |