@@ -434,6 +434,114 @@ __attribute__((deprecated("This API is experimental.")))
434
434
shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
435
435
NS_SWIFT_NAME(init(_:shape:strides:dimensionOrder:dataType:shapeDynamism:));
436
436
437
+ /* *
438
+ * Initializes a tensor with an array of scalar values, specifying shape, strides, dimension order, and data type,
439
+ * using a default dynamic bound shape for shape dynamism.
440
+ *
441
+ * @param scalars An NSArray of NSNumber objects representing the scalar values.
442
+ * @param shape An NSArray of NSNumber objects representing the desired tensor shape.
443
+ * @param strides An NSArray of NSNumber objects representing the tensor strides.
444
+ * @param dimensionOrder An NSArray of NSNumber objects indicating the order of dimensions.
445
+ * @param dataType An ExecuTorchDataType value specifying the element type.
446
+ * @return An initialized ExecuTorchTensor instance containing the scalar values.
447
+ */
448
+ - (instancetype )initWithScalars : (NSArray <NSNumber *> *)scalars
449
+ shape : (NSArray <NSNumber *> *)shape
450
+ strides : (NSArray <NSNumber *> *)strides
451
+ dimensionOrder : (NSArray <NSNumber *> *)dimensionOrder
452
+ dataType : (ExecuTorchDataType)dataType
453
+ NS_SWIFT_NAME(init(_:shape:strides:dimensionOrder:dataType:));
454
+
455
+ /* *
456
+ * Initializes a tensor with an array of scalar values, specifying the desired shape, data type, and explicit shape dynamism.
457
+ *
458
+ * @param scalars An NSArray of NSNumber objects representing the scalar values.
459
+ * @param shape An NSArray of NSNumber objects representing the desired tensor shape.
460
+ * @param dataType An ExecuTorchDataType value specifying the element type.
461
+ * @param shapeDynamism An ExecuTorchShapeDynamism value indicating the shape dynamism.
462
+ * @return An initialized ExecuTorchTensor instance.
463
+ */
464
+ - (instancetype )initWithScalars : (NSArray <NSNumber *> *)scalars
465
+ shape : (NSArray <NSNumber *> *)shape
466
+ dataType : (ExecuTorchDataType)dataType
467
+ shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
468
+ NS_SWIFT_NAME(init(_:shape:dataType:shapeDynamism:));
469
+
470
+ /* *
471
+ * Initializes a tensor with an array of scalar values and a specified shape,
472
+ * using a default dynamic bound shape for shape dynamism.
473
+ *
474
+ * @param scalars An NSArray of NSNumber objects representing the scalar values.
475
+ * @param shape An NSArray of NSNumber objects representing the desired tensor shape.
476
+ * @param dataType An ExecuTorchDataType value specifying the element type.
477
+ * @return An initialized ExecuTorchTensor instance.
478
+ */
479
+ - (instancetype )initWithScalars : (NSArray <NSNumber *> *)scalars
480
+ shape : (NSArray <NSNumber *> *)shape
481
+ dataType : (ExecuTorchDataType)dataType
482
+ NS_SWIFT_NAME(init(_:shape:dataType:));
483
+
484
+ /* *
485
+ * Initializes a tensor with an array of scalar values, specifying the tensor data type and explicit shape dynamism.
486
+ * The shape is deduced from the count of the scalar array.
487
+ *
488
+ * @param scalars An NSArray of NSNumber objects representing the scalar values.
489
+ * @param dataType An ExecuTorchDataType value specifying the element type.
490
+ * @param shapeDynamism An ExecuTorchShapeDynamism value indicating the shape dynamism.
491
+ * @return An initialized ExecuTorchTensor instance with the shape deduced from the scalar count.
492
+ */
493
+ - (instancetype )initWithScalars : (NSArray <NSNumber *> *)scalars
494
+ dataType : (ExecuTorchDataType)dataType
495
+ shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
496
+ NS_SWIFT_NAME(init(_:dataType:shapeDynamism:));
497
+
498
+ /* *
499
+ * Initializes a tensor with an array of scalar values, specifying the tensor data type.
500
+ * The shape is deduced from the count of the scalar array.
501
+ *
502
+ * @param scalars An NSArray of NSNumber objects representing the scalar values.
503
+ * @param dataType An ExecuTorchDataType value specifying the element type.
504
+ * @return An initialized ExecuTorchTensor instance with the shape deduced from the scalar count.
505
+ */
506
+ - (instancetype )initWithScalars : (NSArray <NSNumber *> *)scalars
507
+ dataType : (ExecuTorchDataType)dataType
508
+ NS_SWIFT_NAME(init(_:dataType:));
509
+
510
+ /* *
511
+ * Initializes a tensor with an array of scalar values, a specified shape and explicit shape dynamism.
512
+ * The data type is automatically deduced from the first element of the array.
513
+ *
514
+ * @param scalars An NSArray of NSNumber objects representing the scalar values.
515
+ * @param shape An NSArray of NSNumber objects representing the desired tensor shape.
516
+ * @param shapeDynamism An ExecuTorchShapeDynamism value indicating the shape dynamism.
517
+ * @return An initialized ExecuTorchTensor instance.
518
+ */
519
+ - (instancetype )initWithScalars : (NSArray <NSNumber *> *)scalars
520
+ shape : (NSArray <NSNumber *> *)shape
521
+ shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
522
+ NS_SWIFT_NAME(init(_:shape:shapeDynamism:));
523
+
524
+ /* *
525
+ * Initializes a tensor with an array of scalar values and a specified shape.
526
+ * The data type is automatically deduced from the first element of the array.
527
+ *
528
+ * @param scalars An NSArray of NSNumber objects representing the scalar values.
529
+ * @param shape An NSArray of NSNumber objects representing the desired tensor shape.
530
+ * @return An initialized ExecuTorchTensor instance.
531
+ */
532
+ - (instancetype )initWithScalars : (NSArray <NSNumber *> *)scalars
533
+ shape : (NSArray <NSNumber *> *)shape
534
+ NS_SWIFT_NAME(init(_:shape:));
535
+
536
+ /* *
537
+ * Initializes a tensor with an array of scalar values, automatically deducing the tensor shape and data type.
538
+ *
539
+ * @param scalars An NSArray of NSNumber objects representing the scalar values.
540
+ * @return An initialized ExecuTorchTensor instance with shape and data type deduced.
541
+ */
542
+ - (instancetype )initWithScalars : (NSArray <NSNumber *> *)scalars
543
+ NS_SWIFT_NAME(init(_:));
544
+
437
545
@end
438
546
439
547
NS_ASSUME_NONNULL_END
0 commit comments