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.")))
158158@property(nonatomic, readonly) BOOL  isDouble;
159159
160160/* *
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. 
162165 * 
163166 * @return A BOOL indicating whether the value is a float. 
164167 */  
@@ -208,6 +211,18 @@ __attribute__((deprecated("This API is experimental.")))
208211+ (instancetype )valueWithDouble:(ExecuTorchDoubleValue)value
209212    NS_SWIFT_NAME (init(_:));
210213
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+ 
211226/* *
212227 * Creates an instance encapsulating a scalar value. 
213228 * 
Original file line number Diff line number Diff line change @@ -68,6 +68,11 @@ + (instancetype)valueWithDouble:(ExecuTorchDoubleValue)value {
6868                                        value: @(value)];
6969}
7070
71+ + (instancetype )valueWithFloat : (ExecuTorchFloatValue)value  {
72+   return  [[ExecuTorchValue alloc ] initWithTag: ExecuTorchValueTagDouble
73+                                         value: @(value)];
74+ }
75+ 
7176+ (instancetype )valueWithScalar : (ExecuTorchScalarValue)value  {
7277  return  [[ExecuTorchValue alloc ] initWithTag: deduceValueTag (value)
7378                                        value: value];
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments