Embedding class

Represents the embedding for a given embedder head. Typically used in embedding tasks.

One and only one of 'floatEmbedding' and 'quantizedEmbedding' will contain data, based on whether or not the embedder was configured to perform scala quantization.

This io-friendly implementation is not immutable strictly for memoization of computed fields. All values used by pkg:equatable are in fact immutable.

Inheritance

Constructors

Embedding.float(Float32List floatEmbedding, {required int headIndex, String? headName})
Instantiates a floating point Embedding object with fake values for testing.
Embedding.native(Pointer<Embedding>? _pointer)
Instatiates a Classifications object as a wrapper around native memory.
Embedding.quantized(Uint8List quantizedEmbedding, {required int headIndex, String? headName})
Instantiates a quantized Embedding object with fake values for testing.

Properties

floatEmbedding Float32List?
Floating-point embedding. null if the embedder was configured to perform scalar-quantization.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
headIndex int
The index of the embedder head to which these entries refer.
no setteroverride
headName String?
The optional name of the embedder head, which is the corresponding tensor metadata name.
no setteroverride
isFloat bool
True if this embedding came from an embedder that was not configured to perform scalar quantization.
no setterinherited
isQuantized bool
True if this embedding came from an embedder configured to perform scalar quantization.
no setterinherited
length int
Length of this embedding.
no setteroverride
pointer Pointer<Embedding>?
Read-only access to the internal pointer.
no setter
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setterinherited
quantizedEmbedding Uint8List?
Scalar-quantized embedding. null if the embedder was not configured to perform scalar quantization.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
type EmbeddingType
Indicator for the type of results in this embedding.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromNativeArray(Pointer<Embedding> structs, int count) Iterable<Embedding>
Accepts a pointer to a list of structs, and a count representing the length of the list, and returns a list of pure-Dart Embedding instances.