@@ -902,6 +902,69 @@ __attribute__((deprecated("This API is experimental.")))
902902
903903@end
904904
905+ #pragma mark - Zeros Category
906+
907+ @interface ExecuTorchTensor (Zeros)
908+
909+ /* *
910+ * Creates a tensor filled with zeros, with the specified shape, data type, and shape dynamism.
911+ *
912+ * @param shape An NSArray of NSNumber objects representing the desired shape.
913+ * @param dataType An ExecuTorchDataType value specifying the element type.
914+ * @param shapeDynamism An ExecuTorchShapeDynamism value specifying whether the shape is static or dynamic.
915+ * @return A new ExecuTorchTensor instance filled with zeros.
916+ */
917+ + (instancetype )zerosTensorWithShape : (NSArray <NSNumber *> *)shape
918+ dataType : (ExecuTorchDataType)dataType
919+ shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
920+ NS_SWIFT_NAME(zeros(shape:dataType:shapeDynamism:));
921+
922+ /* *
923+ * Creates a tensor filled with zeros, with the specified shape and data type.
924+ *
925+ * @param shape An NSArray of NSNumber objects representing the desired shape.
926+ * @param dataType An ExecuTorchDataType value specifying the element type.
927+ * @return A new ExecuTorchTensor instance filled with zeros.
928+ */
929+ + (instancetype )zerosTensorWithShape : (NSArray <NSNumber *> *)shape
930+ dataType : (ExecuTorchDataType)dataType
931+ NS_SWIFT_NAME(zeros(shape:dataType:));
932+
933+ /* *
934+ * Creates a tensor filled with zeros similar to an existing tensor, with the specified data type and shape dynamism.
935+ *
936+ * @param tensor An existing ExecuTorchTensor instance whose shape and strides are used.
937+ * @param dataType An ExecuTorchDataType value specifying the desired element type.
938+ * @param shapeDynamism An ExecuTorchShapeDynamism value specifying whether the shape is static or dynamic.
939+ * @return A new ExecuTorchTensor instance filled with zeros.
940+ */
941+ + (instancetype )zerosTensorLikeTensor : (ExecuTorchTensor *)tensor
942+ dataType : (ExecuTorchDataType)dataType
943+ shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
944+ NS_SWIFT_NAME(zeros(like:dataType:shapeDynamism:));
945+
946+ /* *
947+ * Creates a tensor filled with zeros similar to an existing tensor, with the specified data type.
948+ *
949+ * @param tensor An existing ExecuTorchTensor instance whose shape and strides are used.
950+ * @param dataType An ExecuTorchDataType value specifying the desired element type.
951+ * @return A new ExecuTorchTensor instance filled with zeros.
952+ */
953+ + (instancetype )zerosTensorLikeTensor : (ExecuTorchTensor *)tensor
954+ dataType : (ExecuTorchDataType)dataType
955+ NS_SWIFT_NAME(zeros(like:dataType:));
956+
957+ /* *
958+ * Creates a tensor filled with zeros similar to an existing tensor.
959+ *
960+ * @param tensor An existing ExecuTorchTensor instance.
961+ * @return A new ExecuTorchTensor instance filled with zeros.
962+ */
963+ + (instancetype )zerosTensorLikeTensor : (ExecuTorchTensor *)tensor
964+ NS_SWIFT_NAME(zeros(like:));
965+
966+ @end
967+
905968#pragma mark - Random Category
906969
907970@interface ExecuTorchTensor (Random)
0 commit comments