File tree 2 files changed +26
-0
lines changed
extension/apple/ExecuTorch/Exported
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ typedef NSInteger ExecuTorchIntegerValue
40
40
NS_SWIFT_BRIDGED_TYPEDEF NS_SWIFT_NAME (IntegerValue);
41
41
typedef double ExecuTorchDoubleValue
42
42
NS_SWIFT_BRIDGED_TYPEDEF NS_SWIFT_NAME (DoubleValue);
43
+ typedef float ExecuTorchFloatValue
44
+ NS_SWIFT_BRIDGED_TYPEDEF NS_SWIFT_NAME (FloatValue);
43
45
44
46
/* *
45
47
* A dynamic value type used by ExecuTorch.
@@ -100,6 +102,13 @@ __attribute__((deprecated("This API is experimental.")))
100
102
*/
101
103
@property(nonatomic, readonly) ExecuTorchDoubleValue doubleValue NS_SWIFT_NAME (double );
102
104
105
+ /* *
106
+ * The float value if the tag is ExecuTorchValueTagDouble.
107
+ *
108
+ * @return An float representing the float value.
109
+ */
110
+ @property(nonatomic, readonly) ExecuTorchFloatValue floatValue NS_SWIFT_NAME (float );
111
+
103
112
/* *
104
113
* Returns YES if the value is of type None.
105
114
*
@@ -149,6 +158,13 @@ __attribute__((deprecated("This API is experimental.")))
149
158
*/
150
159
@property(nonatomic, readonly) BOOL isDouble;
151
160
161
+ /* *
162
+ * Returns YES if the value is a float.
163
+ *
164
+ * @return A BOOL indicating whether the value is a float.
165
+ */
166
+ @property(nonatomic, readonly) BOOL isFloat;
167
+
152
168
/* *
153
169
* Creates an instance encapsulating a Tensor.
154
170
*
Original file line number Diff line number Diff line change @@ -88,6 +88,12 @@ - (ExecuTorchDoubleValue)doubleValue {
88
88
return [(ExecuTorchScalarValue)_value doubleValue ];
89
89
}
90
90
91
+ - (ExecuTorchFloatValue)floatValue {
92
+ ET_CHECK (self.isFloat );
93
+ // EValue does not have a separate tag for float.
94
+ return [(ExecuTorchScalarValue)_value floatValue ];
95
+ }
96
+
91
97
- (BOOL )isNone {
92
98
return _tag == ExecuTorchValueTagNone;
93
99
}
@@ -118,6 +124,10 @@ - (BOOL)isDouble {
118
124
return _tag == ExecuTorchValueTagDouble;
119
125
}
120
126
127
+ - (BOOL )isFloat {
128
+ return _tag == ExecuTorchValueTagDouble;
129
+ }
130
+
121
131
- (BOOL )isEqualToValue : (nullable ExecuTorchValue *)other {
122
132
if (!other) {
123
133
return NO ;
You can’t perform that action at this time.
0 commit comments