From b04be2ce5dbfbdc224ede39f0f421cda4ce36ea3 Mon Sep 17 00:00:00 2001 From: Anthony Shoumikhin Date: Tue, 25 Mar 2025 15:39:52 -0700 Subject: [PATCH] Enum for Value tag. Summary: . Reviewed By: bsoyluoglu Differential Revision: D71752747 --- .../ExecuTorch/Exported/ExecuTorchValue.h | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/extension/apple/ExecuTorch/Exported/ExecuTorchValue.h b/extension/apple/ExecuTorch/Exported/ExecuTorchValue.h index 9b2c8aaaae6..c524b66b512 100644 --- a/extension/apple/ExecuTorch/Exported/ExecuTorchValue.h +++ b/extension/apple/ExecuTorch/Exported/ExecuTorchValue.h @@ -10,6 +10,26 @@ NS_ASSUME_NONNULL_BEGIN +/** + * Enum to define the dynamic type of a Value. + * Values can be a subset, but must numerically match exactly those defined in + * runtime/core/tag.h + */ +typedef NS_ENUM(uint32_t, ExecuTorchValueTag) { + ExecuTorchValueTagNone, + ExecuTorchValueTagTensor, + ExecuTorchValueTagString, + ExecuTorchValueTagDouble, + ExecuTorchValueTagInteger, + ExecuTorchValueTagBoolean, + ExecuTorchValueTagBooleanList, + ExecuTorchValueTagDoubleList, + ExecuTorchValueTagIntegerList, + ExecuTorchValueTagTensorList, + ExecuTorchValueTagScalarList, + ExecuTorchValueTagOptionalTensorList, +} NS_SWIFT_NAME(ValueTag); + NS_SWIFT_NAME(Value) __attribute__((deprecated("This API is experimental."))) @interface ExecuTorchValue : NSObject