@@ -670,4 +670,82 @@ __attribute__((deprecated("This API is experimental.")))
670670
671671@end
672672
673+ #pragma mark - Empty Category
674+
675+ @interface ExecuTorchTensor (Empty)
676+
677+ /* *
678+ * Creates an empty tensor with the specified shape, strides, data type, and shape dynamism.
679+ *
680+ * @param shape An NSArray of NSNumber objects representing the desired shape.
681+ * @param strides An NSArray of NSNumber objects representing the desired strides.
682+ * @param dataType An ExecuTorchDataType value specifying the element type.
683+ * @param shapeDynamism An ExecuTorchShapeDynamism value specifying whether the shape is static or dynamic.
684+ * @return A new, empty ExecuTorchTensor instance.
685+ */
686+ + (instancetype )emptyTensorWithShape : (NSArray <NSNumber *> *)shape
687+ strides : (NSArray <NSNumber *> *)strides
688+ dataType : (ExecuTorchDataType)dataType
689+ shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
690+ NS_SWIFT_NAME(empty(shape:strides:dataType:shapeDynamism:));
691+
692+ /* *
693+ * Creates an empty tensor with the specified shape, data type, and shape dynamism.
694+ *
695+ * @param shape An NSArray of NSNumber objects representing the desired shape.
696+ * @param dataType An ExecuTorchDataType value specifying the element type.
697+ * @param shapeDynamism An ExecuTorchShapeDynamism value specifying whether the shape is static or dynamic.
698+ * @return A new, empty ExecuTorchTensor instance.
699+ */
700+ + (instancetype )emptyTensorWithShape : (NSArray <NSNumber *> *)shape
701+ dataType : (ExecuTorchDataType)dataType
702+ shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
703+ NS_SWIFT_NAME(empty(shape:dataType:shapeDynamism:));
704+
705+ /* *
706+ * Creates an empty tensor with the specified shape and data type, using dynamic bound shape.
707+ *
708+ * @param shape An NSArray of NSNumber objects representing the desired shape.
709+ * @param dataType An ExecuTorchDataType value specifying the element type.
710+ * @return A new, empty ExecuTorchTensor instance.
711+ */
712+ + (instancetype )emptyTensorWithShape : (NSArray <NSNumber *> *)shape
713+ dataType : (ExecuTorchDataType)dataType
714+ NS_SWIFT_NAME(empty(shape:dataType:));
715+
716+ /* *
717+ * Creates an empty tensor similar to the given tensor, with the specified data type and shape dynamism.
718+ *
719+ * @param tensor An existing ExecuTorchTensor instance whose shape and strides are used.
720+ * @param dataType An ExecuTorchDataType value specifying the desired element type.
721+ * @param shapeDynamism An ExecuTorchShapeDynamism value specifying whether the shape is static or dynamic.
722+ * @return A new, empty ExecuTorchTensor instance with the same shape as the provided tensor.
723+ */
724+ + (instancetype )emptyTensorLikeTensor : (ExecuTorchTensor *)tensor
725+ dataType : (ExecuTorchDataType)dataType
726+ shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
727+ NS_SWIFT_NAME(empty(like:dataType:shapeDynamism:));
728+
729+ /* *
730+ * Creates an empty tensor similar to the given tensor, with the specified data type.
731+ *
732+ * @param tensor An existing ExecuTorchTensor instance whose shape and strides are used.
733+ * @param dataType An ExecuTorchDataType value specifying the desired element type.
734+ * @return A new, empty ExecuTorchTensor instance with the same shape as the provided tensor.
735+ */
736+ + (instancetype )emptyTensorLikeTensor : (ExecuTorchTensor *)tensor
737+ dataType : (ExecuTorchDataType)dataType
738+ NS_SWIFT_NAME(empty(like:dataType:));
739+
740+ /* *
741+ * Creates an empty tensor similar to the given tensor.
742+ *
743+ * @param tensor An existing ExecuTorchTensor instance.
744+ * @return A new, empty ExecuTorchTensor instance with the same properties as the provided tensor.
745+ */
746+ + (instancetype )emptyTensorLikeTensor : (ExecuTorchTensor *)tensor
747+ NS_SWIFT_NAME(empty(like:));
748+
749+ @end
750+
673751NS_ASSUME_NONNULL_END
0 commit comments