MPPEmbedding
@interface MPPEmbedding : 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
Objective-C
@property (nonatomic, readonly, nullable) NSArray<NSNumber *> *floatEmbedding; -
@brief The embedding represented as an
NSArrayofUInt8values. Empty if the embedder was not configured to perform scalar quantization.Declaration
Objective-C
@property (nonatomic, readonly, nullable) NSArray<NSNumber *> *quantizedEmbedding; -
The index of the embedder head these entries refer to. This is useful for multi-head models.
Declaration
Objective-C
@property (nonatomic, readonly) NSInteger headIndex; -
The optional name of the embedder head, which is the corresponding tensor metadata name.
Declaration
Objective-C
@property (nonatomic, readonly, nullable) NSString *headName; -
Initializes a new
MPPEmbeddingwith the given float embedding, quantized embedding, head index and head name.Declaration
Objective-C
- (nonnull instancetype) initWithFloatEmbedding:(nullable NSArray<NSNumber *> *)floatEmbedding quantizedEmbedding:(nullable NSArray<NSNumber *> *)quantizedEmbedding headIndex:(NSInteger)headIndex headName:(nullable NSString *)headName;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
Declaration
Objective-C
- (instancetype)init NS_UNAVAILABLE; -
Undocumented
Declaration
Objective-C
+ (instancetype)new NS_UNAVAILABLE;