File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
extension/apple/ExecuTorch/Exported Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,10 @@ __attribute__((deprecated("This API is experimental.")))
158
158
@property(nonatomic, readonly) BOOL isDouble;
159
159
160
160
/* *
161
- * Returns YES if the value is a float.
161
+ * Returns YES if the value's tag is Double.
162
+ *
163
+ * Note: Since float values are stored with a Double tag, this property will
164
+ * also be YES for values created from floats.
162
165
*
163
166
* @return A BOOL indicating whether the value is a float.
164
167
*/
@@ -208,6 +211,18 @@ __attribute__((deprecated("This API is experimental.")))
208
211
+ (instancetype )valueWithDouble:(ExecuTorchDoubleValue)value
209
212
NS_SWIFT_NAME (init(_:));
210
213
214
+ /* *
215
+ * Creates an instance encapsulating a float value.
216
+ *
217
+ * Note: The underlying value will be stored with a tag of
218
+ * ExecuTorchValueTagDouble, as there is no distinct float tag.
219
+ *
220
+ * @param value A float value.
221
+ * @return A new ExecuTorchValue instance with a tag of ExecuTorchValueTagDouble.
222
+ */
223
+ + (instancetype )valueWithFloat:(ExecuTorchFloatValue)value
224
+ NS_SWIFT_NAME (init(_:));
225
+
211
226
/* *
212
227
* Creates an instance encapsulating a scalar value.
213
228
*
Original file line number Diff line number Diff line change @@ -68,6 +68,11 @@ + (instancetype)valueWithDouble:(ExecuTorchDoubleValue)value {
68
68
value: @(value)];
69
69
}
70
70
71
+ + (instancetype )valueWithFloat : (ExecuTorchFloatValue)value {
72
+ return [[ExecuTorchValue alloc ] initWithTag: ExecuTorchValueTagDouble
73
+ value: @(value)];
74
+ }
75
+
71
76
+ (instancetype )valueWithScalar : (ExecuTorchScalarValue)value {
72
77
return [[ExecuTorchValue alloc ] initWithTag: deduceValueTag (value)
73
78
value: value];
You can’t perform that action at this time.
0 commit comments