Embedding
class Embedding : NSObjectRepresents the embedding for a given embedder head. Typically used in embedding tasks.
One and only one of the two ‘floatEmbedding’ and ‘quantizedEmbedding’ will contain data, based on whether or not the embedder was configured to perform scala quantization.
-
@brief The embedding represented as an
NSArrayofFloatvalues. Empty if the embedder was configured to perform scalar quantization.Declaration
Swift
var floatEmbedding: [NSNumber]? { get } -
@brief The embedding represented as an
NSArrayofUInt8values. Empty if the embedder was not configured to perform scalar quantization.Declaration
Swift
var quantizedEmbedding: [NSNumber]? { get } -
The index of the embedder head these entries refer to. This is useful for multi-head models.
Declaration
Swift
var headIndex: Int { get } -
The optional name of the embedder head, which is the corresponding tensor metadata name.
Declaration
Swift
var headName: String? { get } -
Initializes a new
MPPEmbeddingwith the given float embedding, quantized embedding, head index and head name.Declaration
Swift
init(floatEmbedding: [NSNumber]?, quantizedEmbedding: [NSNumber]?, head headIndex: Int, headName: String?)Parameters
floatEmbeddingThe optional Floating-point embedding.
quantizedEmbeddingThe optional Quantized embedding.
headIndexThe index of the embedder head.
headNameThe optional name of the embedder head.
Return Value
An instance of
MPPEmbeddinginitialized with the given float embedding, quantized embedding, head index and head name. -
Undocumented
-
Undocumented