@@ -692,7 +692,8 @@ __attribute__((deprecated("This API is experimental.")))
692
692
strides : (NSArray <NSNumber *> *)strides
693
693
dataType : (ExecuTorchDataType)dataType
694
694
shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
695
- NS_SWIFT_NAME(empty(shape:strides:dataType:shapeDynamism:));
695
+ NS_SWIFT_NAME(empty(shape:strides:dataType:shapeDynamism:))
696
+ NS_RETURNS_RETAINED;
696
697
697
698
/* *
698
699
* Creates an empty tensor with the specified shape, data type, and shape dynamism.
@@ -705,7 +706,8 @@ __attribute__((deprecated("This API is experimental.")))
705
706
+ (instancetype )emptyTensorWithShape : (NSArray <NSNumber *> *)shape
706
707
dataType : (ExecuTorchDataType)dataType
707
708
shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
708
- NS_SWIFT_NAME(empty(shape:dataType:shapeDynamism:));
709
+ NS_SWIFT_NAME(empty(shape:dataType:shapeDynamism:))
710
+ NS_RETURNS_RETAINED;
709
711
710
712
/* *
711
713
* Creates an empty tensor with the specified shape and data type, using dynamic bound shape.
@@ -716,7 +718,8 @@ __attribute__((deprecated("This API is experimental.")))
716
718
*/
717
719
+ (instancetype )emptyTensorWithShape : (NSArray <NSNumber *> *)shape
718
720
dataType : (ExecuTorchDataType)dataType
719
- NS_SWIFT_NAME(empty(shape:dataType:));
721
+ NS_SWIFT_NAME(empty(shape:dataType:))
722
+ NS_RETURNS_RETAINED;
720
723
721
724
/* *
722
725
* Creates an empty tensor similar to the given tensor, with the specified data type and shape dynamism.
@@ -729,7 +732,8 @@ __attribute__((deprecated("This API is experimental.")))
729
732
+ (instancetype )emptyTensorLikeTensor : (ExecuTorchTensor *)tensor
730
733
dataType : (ExecuTorchDataType)dataType
731
734
shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
732
- NS_SWIFT_NAME(empty(like:dataType:shapeDynamism:));
735
+ NS_SWIFT_NAME(empty(like:dataType:shapeDynamism:))
736
+ NS_RETURNS_RETAINED;
733
737
734
738
/* *
735
739
* Creates an empty tensor similar to the given tensor, with the specified data type.
@@ -740,7 +744,8 @@ __attribute__((deprecated("This API is experimental.")))
740
744
*/
741
745
+ (instancetype )emptyTensorLikeTensor : (ExecuTorchTensor *)tensor
742
746
dataType : (ExecuTorchDataType)dataType
743
- NS_SWIFT_NAME(empty(like:dataType:));
747
+ NS_SWIFT_NAME(empty(like:dataType:))
748
+ NS_RETURNS_RETAINED;
744
749
745
750
/* *
746
751
* Creates an empty tensor similar to the given tensor.
@@ -749,7 +754,8 @@ __attribute__((deprecated("This API is experimental.")))
749
754
* @return A new, empty ExecuTorchTensor instance with the same properties as the provided tensor.
750
755
*/
751
756
+ (instancetype )emptyTensorLikeTensor : (ExecuTorchTensor *)tensor
752
- NS_SWIFT_NAME(empty(like:));
757
+ NS_SWIFT_NAME(empty(like:))
758
+ NS_RETURNS_RETAINED;
753
759
754
760
@end
755
761
@@ -772,7 +778,8 @@ __attribute__((deprecated("This API is experimental.")))
772
778
strides : (NSArray <NSNumber *> *)strides
773
779
dataType : (ExecuTorchDataType)dataType
774
780
shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
775
- NS_SWIFT_NAME(full(shape:scalar:strides:dataType:shapeDynamism:));
781
+ NS_SWIFT_NAME(full(shape:scalar:strides:dataType:shapeDynamism:))
782
+ NS_RETURNS_RETAINED;
776
783
777
784
/* *
778
785
* Creates a tensor filled with the specified scalar value, with the given shape, data type, and shape dynamism.
@@ -787,7 +794,8 @@ __attribute__((deprecated("This API is experimental.")))
787
794
scalar : (NSNumber *)scalar
788
795
dataType : (ExecuTorchDataType)dataType
789
796
shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
790
- NS_SWIFT_NAME(full(shape:scalar:dataType:shapeDynamism:));
797
+ NS_SWIFT_NAME(full(shape:scalar:dataType:shapeDynamism:))
798
+ NS_RETURNS_RETAINED;
791
799
792
800
/* *
793
801
* Creates a tensor filled with the specified scalar value, with the given shape and data type,
@@ -801,7 +809,8 @@ __attribute__((deprecated("This API is experimental.")))
801
809
+ (instancetype )fullTensorWithShape : (NSArray <NSNumber *> *)shape
802
810
scalar : (NSNumber *)scalar
803
811
dataType : (ExecuTorchDataType)dataType
804
- NS_SWIFT_NAME(full(shape:scalar:dataType:));
812
+ NS_SWIFT_NAME(full(shape:scalar:dataType:))
813
+ NS_RETURNS_RETAINED;
805
814
806
815
/* *
807
816
* Creates a tensor filled with the specified scalar value, similar to an existing tensor, with the given data type and shape dynamism.
@@ -816,7 +825,8 @@ __attribute__((deprecated("This API is experimental.")))
816
825
scalar : (NSNumber *)scalar
817
826
dataType : (ExecuTorchDataType)dataType
818
827
shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
819
- NS_SWIFT_NAME(full(like:scalar:dataType:shapeDynamism:));
828
+ NS_SWIFT_NAME(full(like:scalar:dataType:shapeDynamism:))
829
+ NS_RETURNS_RETAINED;
820
830
821
831
/* *
822
832
* Creates a tensor filled with the specified scalar value, similar to an existing tensor, with the given data type.
@@ -829,7 +839,8 @@ __attribute__((deprecated("This API is experimental.")))
829
839
+ (instancetype )fullTensorLikeTensor : (ExecuTorchTensor *)tensr
830
840
scalar : (NSNumber *)scalar
831
841
dataType : (ExecuTorchDataType)dataType
832
- NS_SWIFT_NAME(full(like:scalar:dataType:));
842
+ NS_SWIFT_NAME(full(like:scalar:dataType:))
843
+ NS_RETURNS_RETAINED;
833
844
834
845
/* *
835
846
* Creates a tensor filled with the specified scalar value, similar to an existing tensor.
@@ -840,7 +851,8 @@ __attribute__((deprecated("This API is experimental.")))
840
851
*/
841
852
+ (instancetype )fullTensorLikeTensor : (ExecuTorchTensor *)tensr
842
853
scalar : (NSNumber *)scalar
843
- NS_SWIFT_NAME(full(like:scalar:));
854
+ NS_SWIFT_NAME(full(like:scalar:))
855
+ NS_RETURNS_RETAINED;
844
856
845
857
@end
846
858
@@ -859,7 +871,8 @@ __attribute__((deprecated("This API is experimental.")))
859
871
+ (instancetype )onesTensorWithShape : (NSArray <NSNumber *> *)shape
860
872
dataType : (ExecuTorchDataType)dataType
861
873
shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
862
- NS_SWIFT_NAME(ones(shape:dataType:shapeDynamism:));
874
+ NS_SWIFT_NAME(ones(shape:dataType:shapeDynamism:))
875
+ NS_RETURNS_RETAINED;
863
876
864
877
/* *
865
878
* Creates a tensor filled with ones, with the specified shape and data type.
@@ -870,7 +883,8 @@ __attribute__((deprecated("This API is experimental.")))
870
883
*/
871
884
+ (instancetype )onesTensorWithShape : (NSArray <NSNumber *> *)shape
872
885
dataType : (ExecuTorchDataType)dataType
873
- NS_SWIFT_NAME(ones(shape:dataType:));
886
+ NS_SWIFT_NAME(ones(shape:dataType:))
887
+ NS_RETURNS_RETAINED;
874
888
875
889
/* *
876
890
* Creates a tensor filled with ones similar to an existing tensor, with the specified data type and shape dynamism.
@@ -883,7 +897,8 @@ __attribute__((deprecated("This API is experimental.")))
883
897
+ (instancetype )onesTensorLikeTensor : (ExecuTorchTensor *)tensor
884
898
dataType : (ExecuTorchDataType)dataType
885
899
shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
886
- NS_SWIFT_NAME(ones(like:dataType:shapeDynamism:));
900
+ NS_SWIFT_NAME(ones(like:dataType:shapeDynamism:))
901
+ NS_RETURNS_RETAINED;
887
902
888
903
/* *
889
904
* Creates a tensor filled with ones similar to an existing tensor, with the specified data type.
@@ -894,7 +909,8 @@ __attribute__((deprecated("This API is experimental.")))
894
909
*/
895
910
+ (instancetype )onesTensorLikeTensor : (ExecuTorchTensor *)tensor
896
911
dataType : (ExecuTorchDataType)dataType
897
- NS_SWIFT_NAME(ones(like:dataType:));
912
+ NS_SWIFT_NAME(ones(like:dataType:))
913
+ NS_RETURNS_RETAINED;
898
914
899
915
/* *
900
916
* Creates a tensor filled with ones similar to an existing tensor.
@@ -903,7 +919,8 @@ __attribute__((deprecated("This API is experimental.")))
903
919
* @return A new ExecuTorchTensor instance filled with ones.
904
920
*/
905
921
+ (instancetype )onesTensorLikeTensor : (ExecuTorchTensor *)tensor
906
- NS_SWIFT_NAME(ones(like:));
922
+ NS_SWIFT_NAME(ones(like:))
923
+ NS_RETURNS_RETAINED;
907
924
908
925
@end
909
926
@@ -922,7 +939,8 @@ __attribute__((deprecated("This API is experimental.")))
922
939
+ (instancetype )zerosTensorWithShape : (NSArray <NSNumber *> *)shape
923
940
dataType : (ExecuTorchDataType)dataType
924
941
shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
925
- NS_SWIFT_NAME(zeros(shape:dataType:shapeDynamism:));
942
+ NS_SWIFT_NAME(zeros(shape:dataType:shapeDynamism:))
943
+ NS_RETURNS_RETAINED;
926
944
927
945
/* *
928
946
* Creates a tensor filled with zeros, with the specified shape and data type.
@@ -933,7 +951,8 @@ __attribute__((deprecated("This API is experimental.")))
933
951
*/
934
952
+ (instancetype )zerosTensorWithShape : (NSArray <NSNumber *> *)shape
935
953
dataType : (ExecuTorchDataType)dataType
936
- NS_SWIFT_NAME(zeros(shape:dataType:));
954
+ NS_SWIFT_NAME(zeros(shape:dataType:))
955
+ NS_RETURNS_RETAINED;
937
956
938
957
/* *
939
958
* Creates a tensor filled with zeros similar to an existing tensor, with the specified data type and shape dynamism.
@@ -946,7 +965,8 @@ __attribute__((deprecated("This API is experimental.")))
946
965
+ (instancetype )zerosTensorLikeTensor : (ExecuTorchTensor *)tensor
947
966
dataType : (ExecuTorchDataType)dataType
948
967
shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
949
- NS_SWIFT_NAME(zeros(like:dataType:shapeDynamism:));
968
+ NS_SWIFT_NAME(zeros(like:dataType:shapeDynamism:))
969
+ NS_RETURNS_RETAINED;
950
970
951
971
/* *
952
972
* Creates a tensor filled with zeros similar to an existing tensor, with the specified data type.
@@ -957,7 +977,8 @@ __attribute__((deprecated("This API is experimental.")))
957
977
*/
958
978
+ (instancetype )zerosTensorLikeTensor : (ExecuTorchTensor *)tensor
959
979
dataType : (ExecuTorchDataType)dataType
960
- NS_SWIFT_NAME(zeros(like:dataType:));
980
+ NS_SWIFT_NAME(zeros(like:dataType:))
981
+ NS_RETURNS_RETAINED;
961
982
962
983
/* *
963
984
* Creates a tensor filled with zeros similar to an existing tensor.
@@ -966,7 +987,8 @@ __attribute__((deprecated("This API is experimental.")))
966
987
* @return A new ExecuTorchTensor instance filled with zeros.
967
988
*/
968
989
+ (instancetype )zerosTensorLikeTensor : (ExecuTorchTensor *)tensor
969
- NS_SWIFT_NAME(zeros(like:));
990
+ NS_SWIFT_NAME(zeros(like:))
991
+ NS_RETURNS_RETAINED;
970
992
971
993
@end
972
994
@@ -987,7 +1009,8 @@ __attribute__((deprecated("This API is experimental.")))
987
1009
strides : (NSArray <NSNumber *> *)strides
988
1010
dataType : (ExecuTorchDataType)dataType
989
1011
shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
990
- NS_SWIFT_NAME(rand(shape:strides:dataType:shapeDynamism:));
1012
+ NS_SWIFT_NAME(rand(shape:strides:dataType:shapeDynamism:))
1013
+ NS_RETURNS_RETAINED;
991
1014
992
1015
/* *
993
1016
* Creates a tensor with random values, with the specified shape and data type.
@@ -1000,7 +1023,8 @@ __attribute__((deprecated("This API is experimental.")))
1000
1023
+ (instancetype )randomTensorWithShape : (NSArray <NSNumber *> *)shape
1001
1024
dataType : (ExecuTorchDataType)dataType
1002
1025
shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
1003
- NS_SWIFT_NAME(rand(shape:dataType:shapeDynamism:));
1026
+ NS_SWIFT_NAME(rand(shape:dataType:shapeDynamism:))
1027
+ NS_RETURNS_RETAINED;
1004
1028
1005
1029
/* *
1006
1030
* Creates a tensor with random values, with the specified shape (using dynamic bound shape) and data type.
@@ -1011,7 +1035,8 @@ __attribute__((deprecated("This API is experimental.")))
1011
1035
*/
1012
1036
+ (instancetype )randomTensorWithShape : (NSArray <NSNumber *> *)shape
1013
1037
dataType : (ExecuTorchDataType)dataType
1014
- NS_SWIFT_NAME(rand(shape:dataType:));
1038
+ NS_SWIFT_NAME(rand(shape:dataType:))
1039
+ NS_RETURNS_RETAINED;
1015
1040
1016
1041
/* *
1017
1042
* Creates a tensor with random values similar to an existing tensor, with the specified data type and shape dynamism.
@@ -1024,7 +1049,8 @@ __attribute__((deprecated("This API is experimental.")))
1024
1049
+ (instancetype )randomTensorLikeTensor : (ExecuTorchTensor *)tensor
1025
1050
dataType : (ExecuTorchDataType)dataType
1026
1051
shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
1027
- NS_SWIFT_NAME(rand(like:dataType:shapeDynamism:));
1052
+ NS_SWIFT_NAME(rand(like:dataType:shapeDynamism:))
1053
+ NS_RETURNS_RETAINED;
1028
1054
1029
1055
/* *
1030
1056
* Creates a tensor with random values similar to an existing tensor, with the specified data type.
@@ -1035,7 +1061,8 @@ __attribute__((deprecated("This API is experimental.")))
1035
1061
*/
1036
1062
+ (instancetype )randomTensorLikeTensor : (ExecuTorchTensor *)tensor
1037
1063
dataType : (ExecuTorchDataType)dataType
1038
- NS_SWIFT_NAME(rand(like:dataType:));
1064
+ NS_SWIFT_NAME(rand(like:dataType:))
1065
+ NS_RETURNS_RETAINED;
1039
1066
1040
1067
/* *
1041
1068
* Creates a tensor with random values similar to an existing tensor.
@@ -1044,7 +1071,8 @@ __attribute__((deprecated("This API is experimental.")))
1044
1071
* @return A new ExecuTorchTensor instance filled with random values.
1045
1072
*/
1046
1073
+ (instancetype )randomTensorLikeTensor : (ExecuTorchTensor *)tensor
1047
- NS_SWIFT_NAME(rand(like:));
1074
+ NS_SWIFT_NAME(rand(like:))
1075
+ NS_RETURNS_RETAINED;
1048
1076
1049
1077
@end
1050
1078
@@ -1066,7 +1094,8 @@ __attribute__((deprecated("This API is experimental.")))
1066
1094
strides : (NSArray <NSNumber *> *)strides
1067
1095
dataType : (ExecuTorchDataType)dataType
1068
1096
shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
1069
- NS_SWIFT_NAME(randn(shape:strides:dataType:shapeDynamism:));
1097
+ NS_SWIFT_NAME(randn(shape:strides:dataType:shapeDynamism:))
1098
+ NS_RETURNS_RETAINED;
1070
1099
1071
1100
/* *
1072
1101
* Creates a tensor with random values drawn from a normal distribution,
@@ -1080,7 +1109,8 @@ __attribute__((deprecated("This API is experimental.")))
1080
1109
+ (instancetype )randomNormalTensorWithShape : (NSArray <NSNumber *> *)shape
1081
1110
dataType : (ExecuTorchDataType)dataType
1082
1111
shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
1083
- NS_SWIFT_NAME(randn(shape:dataType:shapeDynamism:));
1112
+ NS_SWIFT_NAME(randn(shape:dataType:shapeDynamism:))
1113
+ NS_RETURNS_RETAINED;
1084
1114
1085
1115
/* *
1086
1116
* Creates a tensor with random values drawn from a normal distribution,
@@ -1092,7 +1122,8 @@ __attribute__((deprecated("This API is experimental.")))
1092
1122
*/
1093
1123
+ (instancetype )randomNormalTensorWithShape : (NSArray <NSNumber *> *)shape
1094
1124
dataType : (ExecuTorchDataType)dataType
1095
- NS_SWIFT_NAME(randn(shape:dataType:));
1125
+ NS_SWIFT_NAME(randn(shape:dataType:))
1126
+ NS_RETURNS_RETAINED;
1096
1127
1097
1128
/* *
1098
1129
* Creates a tensor with random normal values similar to an existing tensor,
@@ -1106,7 +1137,8 @@ __attribute__((deprecated("This API is experimental.")))
1106
1137
+ (instancetype )randomNormalTensorLikeTensor : (ExecuTorchTensor *)tensor
1107
1138
dataType : (ExecuTorchDataType)dataType
1108
1139
shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
1109
- NS_SWIFT_NAME(randn(like:dataType:shapeDynamism:));
1140
+ NS_SWIFT_NAME(randn(like:dataType:shapeDynamism:))
1141
+ NS_RETURNS_RETAINED;
1110
1142
1111
1143
/* *
1112
1144
* Creates a tensor with random normal values similar to an existing tensor,
@@ -1118,7 +1150,8 @@ __attribute__((deprecated("This API is experimental.")))
1118
1150
*/
1119
1151
+ (instancetype )randomNormalTensorLikeTensor : (ExecuTorchTensor *)tensor
1120
1152
dataType : (ExecuTorchDataType)dataType
1121
- NS_SWIFT_NAME(randn(like:dataType:));
1153
+ NS_SWIFT_NAME(randn(like:dataType:))
1154
+ NS_RETURNS_RETAINED;
1122
1155
1123
1156
/* *
1124
1157
* Creates a tensor with random normal values similar to an existing tensor.
@@ -1127,7 +1160,8 @@ __attribute__((deprecated("This API is experimental.")))
1127
1160
* @return A new ExecuTorchTensor instance filled with values from a normal distribution.
1128
1161
*/
1129
1162
+ (instancetype )randomNormalTensorLikeTensor : (ExecuTorchTensor *)tensor
1130
- NS_SWIFT_NAME(randn(like:));
1163
+ NS_SWIFT_NAME(randn(like:))
1164
+ NS_RETURNS_RETAINED;
1131
1165
1132
1166
@end
1133
1167
@@ -1153,7 +1187,8 @@ __attribute__((deprecated("This API is experimental.")))
1153
1187
strides : (NSArray <NSNumber *> *)strides
1154
1188
dataType : (ExecuTorchDataType)dataType
1155
1189
shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
1156
- NS_SWIFT_NAME(randint(low:high:shape:strides:dataType:shapeDynamism:));
1190
+ NS_SWIFT_NAME(randint(low:high:shape:strides:dataType:shapeDynamism:))
1191
+ NS_RETURNS_RETAINED;
1157
1192
1158
1193
/* *
1159
1194
* Creates a tensor with random integer values in the specified range,
@@ -1171,7 +1206,8 @@ __attribute__((deprecated("This API is experimental.")))
1171
1206
shape : (NSArray <NSNumber *> *)shape
1172
1207
dataType : (ExecuTorchDataType)dataType
1173
1208
shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
1174
- NS_SWIFT_NAME(randint(low:high:shape:dataType:shapeDynamism:));
1209
+ NS_SWIFT_NAME(randint(low:high:shape:dataType:shapeDynamism:))
1210
+ NS_RETURNS_RETAINED;
1175
1211
1176
1212
/* *
1177
1213
* Creates a tensor with random integer values in the specified range,
@@ -1187,7 +1223,8 @@ __attribute__((deprecated("This API is experimental.")))
1187
1223
high : (NSInteger )high
1188
1224
shape : (NSArray <NSNumber *> *)shape
1189
1225
dataType : (ExecuTorchDataType)dataType
1190
- NS_SWIFT_NAME(randint(low:high:shape:dataType:));
1226
+ NS_SWIFT_NAME(randint(low:high:shape:dataType:))
1227
+ NS_RETURNS_RETAINED;
1191
1228
1192
1229
/* *
1193
1230
* Creates a tensor with random integer values in the specified range, similar to an existing tensor,
@@ -1205,7 +1242,8 @@ __attribute__((deprecated("This API is experimental.")))
1205
1242
high : (NSInteger )high
1206
1243
dataType : (ExecuTorchDataType)dataType
1207
1244
shapeDynamism : (ExecuTorchShapeDynamism)shapeDynamism
1208
- NS_SWIFT_NAME(randint(like:low:high:dataType:shapeDynamism:));
1245
+ NS_SWIFT_NAME(randint(like:low:high:dataType:shapeDynamism:))
1246
+ NS_RETURNS_RETAINED;
1209
1247
1210
1248
/* *
1211
1249
* Creates a tensor with random integer values in the specified range, similar to an existing tensor,
@@ -1221,7 +1259,8 @@ __attribute__((deprecated("This API is experimental.")))
1221
1259
low : (NSInteger )low
1222
1260
high : (NSInteger )high
1223
1261
dataType : (ExecuTorchDataType)dataType
1224
- NS_SWIFT_NAME(randint(like:low:high:dataType:));
1262
+ NS_SWIFT_NAME(randint(like:low:high:dataType:))
1263
+ NS_RETURNS_RETAINED;
1225
1264
1226
1265
/* *
1227
1266
* Creates a tensor with random integer values in the specified range, similar to an existing tensor.
@@ -1234,7 +1273,8 @@ __attribute__((deprecated("This API is experimental.")))
1234
1273
+ (instancetype )randomIntegerTensorLikeTensor : (ExecuTorchTensor *)tensor
1235
1274
low : (NSInteger )low
1236
1275
high : (NSInteger )high
1237
- NS_SWIFT_NAME(randint(like:low:high:));
1276
+ NS_SWIFT_NAME(randint(like:low:high:))
1277
+ NS_RETURNS_RETAINED;
1238
1278
1239
1279
@end
1240
1280
0 commit comments