From 8c21dc02a6699bf0a4673ffe1adb757d01044248 Mon Sep 17 00:00:00 2001 From: Prianka Liz Kariat Date: Mon, 30 Jan 2023 11:42:33 +0530 Subject: [PATCH] Updated to types of float and quantized embedding --- .../ios/components/containers/sources/MPPEmbedding.h | 8 ++++---- .../ios/components/containers/sources/MPPEmbedding.m | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mediapipe/tasks/ios/components/containers/sources/MPPEmbedding.h b/mediapipe/tasks/ios/components/containers/sources/MPPEmbedding.h index b2104990..77780fc5 100644 --- a/mediapipe/tasks/ios/components/containers/sources/MPPEmbedding.h +++ b/mediapipe/tasks/ios/components/containers/sources/MPPEmbedding.h @@ -29,13 +29,13 @@ NS_SWIFT_NAME(Embedding) * @brief The Floating-point embedding. * Empty if the embedder was configured to perform scalar quantization. */ -@property(nonatomic, readonly, nullable) float *floatEmbedding; +@property(nonatomic, readonly, nullable) NSArray *floatEmbedding; /** * @brief The Quantized embedding. * Empty if the embedder was not configured to perform scalar quantization. */ -@property(nonatomic, readonly, nullable) char *quantizedEmbedding; +@property(nonatomic, readonly, nullable) NSData *quantizedEmbedding; /** The index of the embedder head these entries refer to. This is useful for multi-head models. */ @property(nonatomic, readonly) NSInteger headIndex; @@ -55,8 +55,8 @@ NS_SWIFT_NAME(Embedding) * @return An instance of `MPPEmbedding` initialized with the given float embedding, quantized * embedding, head index and head name. */ -- (instancetype)initWithFloatEmbedding:(nullable float *)floatEmbedding - quantizedEmbedding:(nullable char *)quantizedEmbedding +- (instancetype)initWithFloatEmbedding:(nullable NSArray *)floatEmbedding + quantizedEmbedding:(nullable NSData *)quantizedEmbedding headIndex:(NSInteger)headIndex headName:(nullable NSString *)headName NS_DESIGNATED_INITIALIZER; diff --git a/mediapipe/tasks/ios/components/containers/sources/MPPEmbedding.m b/mediapipe/tasks/ios/components/containers/sources/MPPEmbedding.m index a4c1e224..17e216a2 100644 --- a/mediapipe/tasks/ios/components/containers/sources/MPPEmbedding.m +++ b/mediapipe/tasks/ios/components/containers/sources/MPPEmbedding.m @@ -16,8 +16,8 @@ @implementation MPPEmbedding -- (instancetype)initWithFloatEmbedding:(nullable float *)floatEmbedding - quantizedEmbedding:(nullable char *)quantizedEmbedding +- (instancetype)initWithFloatEmbedding:(nullable NSArray *)floatEmbedding + quantizedEmbedding:(nullable NSData *)quantizedEmbedding headIndex:(NSInteger)headIndex headName:(nullable NSString *)headName { self = [super init];