Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 80 additions & 40 deletions extension/apple/ExecuTorch/Exported/ExecuTorchTensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,8 @@ __attribute__((deprecated("This API is experimental.")))
strides:(NSArray<NSNumber *> *)strides
dataType:(ExecuTorchDataType)dataType
shapeDynamism:(ExecuTorchShapeDynamism)shapeDynamism
NS_SWIFT_NAME(empty(shape:strides:dataType:shapeDynamism:));
NS_SWIFT_NAME(empty(shape:strides:dataType:shapeDynamism:))
NS_RETURNS_RETAINED;

/**
* Creates an empty tensor with the specified shape, data type, and shape dynamism.
Expand All @@ -705,7 +706,8 @@ __attribute__((deprecated("This API is experimental.")))
+ (instancetype)emptyTensorWithShape:(NSArray<NSNumber *> *)shape
dataType:(ExecuTorchDataType)dataType
shapeDynamism:(ExecuTorchShapeDynamism)shapeDynamism
NS_SWIFT_NAME(empty(shape:dataType:shapeDynamism:));
NS_SWIFT_NAME(empty(shape:dataType:shapeDynamism:))
NS_RETURNS_RETAINED;

/**
* Creates an empty tensor with the specified shape and data type, using dynamic bound shape.
Expand All @@ -716,7 +718,8 @@ __attribute__((deprecated("This API is experimental.")))
*/
+ (instancetype)emptyTensorWithShape:(NSArray<NSNumber *> *)shape
dataType:(ExecuTorchDataType)dataType
NS_SWIFT_NAME(empty(shape:dataType:));
NS_SWIFT_NAME(empty(shape:dataType:))
NS_RETURNS_RETAINED;

/**
* Creates an empty tensor similar to the given tensor, with the specified data type and shape dynamism.
Expand All @@ -729,7 +732,8 @@ __attribute__((deprecated("This API is experimental.")))
+ (instancetype)emptyTensorLikeTensor:(ExecuTorchTensor *)tensor
dataType:(ExecuTorchDataType)dataType
shapeDynamism:(ExecuTorchShapeDynamism)shapeDynamism
NS_SWIFT_NAME(empty(like:dataType:shapeDynamism:));
NS_SWIFT_NAME(empty(like:dataType:shapeDynamism:))
NS_RETURNS_RETAINED;

/**
* Creates an empty tensor similar to the given tensor, with the specified data type.
Expand All @@ -740,7 +744,8 @@ __attribute__((deprecated("This API is experimental.")))
*/
+ (instancetype)emptyTensorLikeTensor:(ExecuTorchTensor *)tensor
dataType:(ExecuTorchDataType)dataType
NS_SWIFT_NAME(empty(like:dataType:));
NS_SWIFT_NAME(empty(like:dataType:))
NS_RETURNS_RETAINED;

/**
* Creates an empty tensor similar to the given tensor.
Expand All @@ -749,7 +754,8 @@ __attribute__((deprecated("This API is experimental.")))
* @return A new, empty ExecuTorchTensor instance with the same properties as the provided tensor.
*/
+ (instancetype)emptyTensorLikeTensor:(ExecuTorchTensor *)tensor
NS_SWIFT_NAME(empty(like:));
NS_SWIFT_NAME(empty(like:))
NS_RETURNS_RETAINED;

@end

Expand All @@ -772,7 +778,8 @@ __attribute__((deprecated("This API is experimental.")))
strides:(NSArray<NSNumber *> *)strides
dataType:(ExecuTorchDataType)dataType
shapeDynamism:(ExecuTorchShapeDynamism)shapeDynamism
NS_SWIFT_NAME(full(shape:scalar:strides:dataType:shapeDynamism:));
NS_SWIFT_NAME(full(shape:scalar:strides:dataType:shapeDynamism:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor filled with the specified scalar value, with the given shape, data type, and shape dynamism.
Expand All @@ -787,7 +794,8 @@ __attribute__((deprecated("This API is experimental.")))
scalar:(NSNumber *)scalar
dataType:(ExecuTorchDataType)dataType
shapeDynamism:(ExecuTorchShapeDynamism)shapeDynamism
NS_SWIFT_NAME(full(shape:scalar:dataType:shapeDynamism:));
NS_SWIFT_NAME(full(shape:scalar:dataType:shapeDynamism:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor filled with the specified scalar value, with the given shape and data type,
Expand All @@ -801,7 +809,8 @@ __attribute__((deprecated("This API is experimental.")))
+ (instancetype)fullTensorWithShape:(NSArray<NSNumber *> *)shape
scalar:(NSNumber *)scalar
dataType:(ExecuTorchDataType)dataType
NS_SWIFT_NAME(full(shape:scalar:dataType:));
NS_SWIFT_NAME(full(shape:scalar:dataType:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor filled with the specified scalar value, similar to an existing tensor, with the given data type and shape dynamism.
Expand All @@ -816,7 +825,8 @@ __attribute__((deprecated("This API is experimental.")))
scalar:(NSNumber *)scalar
dataType:(ExecuTorchDataType)dataType
shapeDynamism:(ExecuTorchShapeDynamism)shapeDynamism
NS_SWIFT_NAME(full(like:scalar:dataType:shapeDynamism:));
NS_SWIFT_NAME(full(like:scalar:dataType:shapeDynamism:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor filled with the specified scalar value, similar to an existing tensor, with the given data type.
Expand All @@ -829,7 +839,8 @@ __attribute__((deprecated("This API is experimental.")))
+ (instancetype)fullTensorLikeTensor:(ExecuTorchTensor *)tensr
scalar:(NSNumber *)scalar
dataType:(ExecuTorchDataType)dataType
NS_SWIFT_NAME(full(like:scalar:dataType:));
NS_SWIFT_NAME(full(like:scalar:dataType:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor filled with the specified scalar value, similar to an existing tensor.
Expand All @@ -840,7 +851,8 @@ __attribute__((deprecated("This API is experimental.")))
*/
+ (instancetype)fullTensorLikeTensor:(ExecuTorchTensor *)tensr
scalar:(NSNumber *)scalar
NS_SWIFT_NAME(full(like:scalar:));
NS_SWIFT_NAME(full(like:scalar:))
NS_RETURNS_RETAINED;

@end

Expand All @@ -859,7 +871,8 @@ __attribute__((deprecated("This API is experimental.")))
+ (instancetype)onesTensorWithShape:(NSArray<NSNumber *> *)shape
dataType:(ExecuTorchDataType)dataType
shapeDynamism:(ExecuTorchShapeDynamism)shapeDynamism
NS_SWIFT_NAME(ones(shape:dataType:shapeDynamism:));
NS_SWIFT_NAME(ones(shape:dataType:shapeDynamism:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor filled with ones, with the specified shape and data type.
Expand All @@ -870,7 +883,8 @@ __attribute__((deprecated("This API is experimental.")))
*/
+ (instancetype)onesTensorWithShape:(NSArray<NSNumber *> *)shape
dataType:(ExecuTorchDataType)dataType
NS_SWIFT_NAME(ones(shape:dataType:));
NS_SWIFT_NAME(ones(shape:dataType:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor filled with ones similar to an existing tensor, with the specified data type and shape dynamism.
Expand All @@ -883,7 +897,8 @@ __attribute__((deprecated("This API is experimental.")))
+ (instancetype)onesTensorLikeTensor:(ExecuTorchTensor *)tensor
dataType:(ExecuTorchDataType)dataType
shapeDynamism:(ExecuTorchShapeDynamism)shapeDynamism
NS_SWIFT_NAME(ones(like:dataType:shapeDynamism:));
NS_SWIFT_NAME(ones(like:dataType:shapeDynamism:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor filled with ones similar to an existing tensor, with the specified data type.
Expand All @@ -894,7 +909,8 @@ __attribute__((deprecated("This API is experimental.")))
*/
+ (instancetype)onesTensorLikeTensor:(ExecuTorchTensor *)tensor
dataType:(ExecuTorchDataType)dataType
NS_SWIFT_NAME(ones(like:dataType:));
NS_SWIFT_NAME(ones(like:dataType:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor filled with ones similar to an existing tensor.
Expand All @@ -903,7 +919,8 @@ __attribute__((deprecated("This API is experimental.")))
* @return A new ExecuTorchTensor instance filled with ones.
*/
+ (instancetype)onesTensorLikeTensor:(ExecuTorchTensor *)tensor
NS_SWIFT_NAME(ones(like:));
NS_SWIFT_NAME(ones(like:))
NS_RETURNS_RETAINED;

@end

Expand All @@ -922,7 +939,8 @@ __attribute__((deprecated("This API is experimental.")))
+ (instancetype)zerosTensorWithShape:(NSArray<NSNumber *> *)shape
dataType:(ExecuTorchDataType)dataType
shapeDynamism:(ExecuTorchShapeDynamism)shapeDynamism
NS_SWIFT_NAME(zeros(shape:dataType:shapeDynamism:));
NS_SWIFT_NAME(zeros(shape:dataType:shapeDynamism:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor filled with zeros, with the specified shape and data type.
Expand All @@ -933,7 +951,8 @@ __attribute__((deprecated("This API is experimental.")))
*/
+ (instancetype)zerosTensorWithShape:(NSArray<NSNumber *> *)shape
dataType:(ExecuTorchDataType)dataType
NS_SWIFT_NAME(zeros(shape:dataType:));
NS_SWIFT_NAME(zeros(shape:dataType:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor filled with zeros similar to an existing tensor, with the specified data type and shape dynamism.
Expand All @@ -946,7 +965,8 @@ __attribute__((deprecated("This API is experimental.")))
+ (instancetype)zerosTensorLikeTensor:(ExecuTorchTensor *)tensor
dataType:(ExecuTorchDataType)dataType
shapeDynamism:(ExecuTorchShapeDynamism)shapeDynamism
NS_SWIFT_NAME(zeros(like:dataType:shapeDynamism:));
NS_SWIFT_NAME(zeros(like:dataType:shapeDynamism:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor filled with zeros similar to an existing tensor, with the specified data type.
Expand All @@ -957,7 +977,8 @@ __attribute__((deprecated("This API is experimental.")))
*/
+ (instancetype)zerosTensorLikeTensor:(ExecuTorchTensor *)tensor
dataType:(ExecuTorchDataType)dataType
NS_SWIFT_NAME(zeros(like:dataType:));
NS_SWIFT_NAME(zeros(like:dataType:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor filled with zeros similar to an existing tensor.
Expand All @@ -966,7 +987,8 @@ __attribute__((deprecated("This API is experimental.")))
* @return A new ExecuTorchTensor instance filled with zeros.
*/
+ (instancetype)zerosTensorLikeTensor:(ExecuTorchTensor *)tensor
NS_SWIFT_NAME(zeros(like:));
NS_SWIFT_NAME(zeros(like:))
NS_RETURNS_RETAINED;

@end

Expand All @@ -987,7 +1009,8 @@ __attribute__((deprecated("This API is experimental.")))
strides:(NSArray<NSNumber *> *)strides
dataType:(ExecuTorchDataType)dataType
shapeDynamism:(ExecuTorchShapeDynamism)shapeDynamism
NS_SWIFT_NAME(rand(shape:strides:dataType:shapeDynamism:));
NS_SWIFT_NAME(rand(shape:strides:dataType:shapeDynamism:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor with random values, with the specified shape and data type.
Expand All @@ -1000,7 +1023,8 @@ __attribute__((deprecated("This API is experimental.")))
+ (instancetype)randomTensorWithShape:(NSArray<NSNumber *> *)shape
dataType:(ExecuTorchDataType)dataType
shapeDynamism:(ExecuTorchShapeDynamism)shapeDynamism
NS_SWIFT_NAME(rand(shape:dataType:shapeDynamism:));
NS_SWIFT_NAME(rand(shape:dataType:shapeDynamism:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor with random values, with the specified shape (using dynamic bound shape) and data type.
Expand All @@ -1011,7 +1035,8 @@ __attribute__((deprecated("This API is experimental.")))
*/
+ (instancetype)randomTensorWithShape:(NSArray<NSNumber *> *)shape
dataType:(ExecuTorchDataType)dataType
NS_SWIFT_NAME(rand(shape:dataType:));
NS_SWIFT_NAME(rand(shape:dataType:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor with random values similar to an existing tensor, with the specified data type and shape dynamism.
Expand All @@ -1024,7 +1049,8 @@ __attribute__((deprecated("This API is experimental.")))
+ (instancetype)randomTensorLikeTensor:(ExecuTorchTensor *)tensor
dataType:(ExecuTorchDataType)dataType
shapeDynamism:(ExecuTorchShapeDynamism)shapeDynamism
NS_SWIFT_NAME(rand(like:dataType:shapeDynamism:));
NS_SWIFT_NAME(rand(like:dataType:shapeDynamism:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor with random values similar to an existing tensor, with the specified data type.
Expand All @@ -1035,7 +1061,8 @@ __attribute__((deprecated("This API is experimental.")))
*/
+ (instancetype)randomTensorLikeTensor:(ExecuTorchTensor *)tensor
dataType:(ExecuTorchDataType)dataType
NS_SWIFT_NAME(rand(like:dataType:));
NS_SWIFT_NAME(rand(like:dataType:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor with random values similar to an existing tensor.
Expand All @@ -1044,7 +1071,8 @@ __attribute__((deprecated("This API is experimental.")))
* @return A new ExecuTorchTensor instance filled with random values.
*/
+ (instancetype)randomTensorLikeTensor:(ExecuTorchTensor *)tensor
NS_SWIFT_NAME(rand(like:));
NS_SWIFT_NAME(rand(like:))
NS_RETURNS_RETAINED;

@end

Expand All @@ -1066,7 +1094,8 @@ __attribute__((deprecated("This API is experimental.")))
strides:(NSArray<NSNumber *> *)strides
dataType:(ExecuTorchDataType)dataType
shapeDynamism:(ExecuTorchShapeDynamism)shapeDynamism
NS_SWIFT_NAME(randn(shape:strides:dataType:shapeDynamism:));
NS_SWIFT_NAME(randn(shape:strides:dataType:shapeDynamism:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor with random values drawn from a normal distribution,
Expand All @@ -1080,7 +1109,8 @@ __attribute__((deprecated("This API is experimental.")))
+ (instancetype)randomNormalTensorWithShape:(NSArray<NSNumber *> *)shape
dataType:(ExecuTorchDataType)dataType
shapeDynamism:(ExecuTorchShapeDynamism)shapeDynamism
NS_SWIFT_NAME(randn(shape:dataType:shapeDynamism:));
NS_SWIFT_NAME(randn(shape:dataType:shapeDynamism:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor with random values drawn from a normal distribution,
Expand All @@ -1092,7 +1122,8 @@ __attribute__((deprecated("This API is experimental.")))
*/
+ (instancetype)randomNormalTensorWithShape:(NSArray<NSNumber *> *)shape
dataType:(ExecuTorchDataType)dataType
NS_SWIFT_NAME(randn(shape:dataType:));
NS_SWIFT_NAME(randn(shape:dataType:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor with random normal values similar to an existing tensor,
Expand All @@ -1106,7 +1137,8 @@ __attribute__((deprecated("This API is experimental.")))
+ (instancetype)randomNormalTensorLikeTensor:(ExecuTorchTensor *)tensor
dataType:(ExecuTorchDataType)dataType
shapeDynamism:(ExecuTorchShapeDynamism)shapeDynamism
NS_SWIFT_NAME(randn(like:dataType:shapeDynamism:));
NS_SWIFT_NAME(randn(like:dataType:shapeDynamism:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor with random normal values similar to an existing tensor,
Expand All @@ -1118,7 +1150,8 @@ __attribute__((deprecated("This API is experimental.")))
*/
+ (instancetype)randomNormalTensorLikeTensor:(ExecuTorchTensor *)tensor
dataType:(ExecuTorchDataType)dataType
NS_SWIFT_NAME(randn(like:dataType:));
NS_SWIFT_NAME(randn(like:dataType:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor with random normal values similar to an existing tensor.
Expand All @@ -1127,7 +1160,8 @@ __attribute__((deprecated("This API is experimental.")))
* @return A new ExecuTorchTensor instance filled with values from a normal distribution.
*/
+ (instancetype)randomNormalTensorLikeTensor:(ExecuTorchTensor *)tensor
NS_SWIFT_NAME(randn(like:));
NS_SWIFT_NAME(randn(like:))
NS_RETURNS_RETAINED;

@end

Expand All @@ -1153,7 +1187,8 @@ __attribute__((deprecated("This API is experimental.")))
strides:(NSArray<NSNumber *> *)strides
dataType:(ExecuTorchDataType)dataType
shapeDynamism:(ExecuTorchShapeDynamism)shapeDynamism
NS_SWIFT_NAME(randint(low:high:shape:strides:dataType:shapeDynamism:));
NS_SWIFT_NAME(randint(low:high:shape:strides:dataType:shapeDynamism:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor with random integer values in the specified range,
Expand All @@ -1171,7 +1206,8 @@ __attribute__((deprecated("This API is experimental.")))
shape:(NSArray<NSNumber *> *)shape
dataType:(ExecuTorchDataType)dataType
shapeDynamism:(ExecuTorchShapeDynamism)shapeDynamism
NS_SWIFT_NAME(randint(low:high:shape:dataType:shapeDynamism:));
NS_SWIFT_NAME(randint(low:high:shape:dataType:shapeDynamism:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor with random integer values in the specified range,
Expand All @@ -1187,7 +1223,8 @@ __attribute__((deprecated("This API is experimental.")))
high:(NSInteger)high
shape:(NSArray<NSNumber *> *)shape
dataType:(ExecuTorchDataType)dataType
NS_SWIFT_NAME(randint(low:high:shape:dataType:));
NS_SWIFT_NAME(randint(low:high:shape:dataType:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor with random integer values in the specified range, similar to an existing tensor,
Expand All @@ -1205,7 +1242,8 @@ __attribute__((deprecated("This API is experimental.")))
high:(NSInteger)high
dataType:(ExecuTorchDataType)dataType
shapeDynamism:(ExecuTorchShapeDynamism)shapeDynamism
NS_SWIFT_NAME(randint(like:low:high:dataType:shapeDynamism:));
NS_SWIFT_NAME(randint(like:low:high:dataType:shapeDynamism:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor with random integer values in the specified range, similar to an existing tensor,
Expand All @@ -1221,7 +1259,8 @@ __attribute__((deprecated("This API is experimental.")))
low:(NSInteger)low
high:(NSInteger)high
dataType:(ExecuTorchDataType)dataType
NS_SWIFT_NAME(randint(like:low:high:dataType:));
NS_SWIFT_NAME(randint(like:low:high:dataType:))
NS_RETURNS_RETAINED;

/**
* Creates a tensor with random integer values in the specified range, similar to an existing tensor.
Expand All @@ -1234,7 +1273,8 @@ __attribute__((deprecated("This API is experimental.")))
+ (instancetype)randomIntegerTensorLikeTensor:(ExecuTorchTensor *)tensor
low:(NSInteger)low
high:(NSInteger)high
NS_SWIFT_NAME(randint(like:low:high:));
NS_SWIFT_NAME(randint(like:low:high:))
NS_RETURNS_RETAINED;

@end

Expand Down
Loading