Skip to content

Commit 4affee3

Browse files
authored
Remove deprecation annotations from ObjC/Swift bindings.
Differential Revision: D83283835 Pull Request resolved: #14613
1 parent c98079a commit 4affee3

File tree

7 files changed

+1
-92
lines changed

7 files changed

+1
-92
lines changed

extension/apple/ExecuTorch/Exported/ExecuTorch+Module.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
@_exported import ExecuTorch
1010

11-
@available(*, deprecated, message: "This API is experimental.")
1211
public extension TensorMetadata {
1312
/// The size of each dimension.
1413
var shape: [Int] { __shape.map(\.intValue) }
@@ -17,7 +16,6 @@ public extension TensorMetadata {
1716
var dimensionOrder: [Int] { __dimensionOrder.map(\.intValue) }
1817
}
1918

20-
@available(*, deprecated, message: "This API is experimental.")
2119
public extension MethodMetadata {
2220
/// The declared input tags.
2321
var inputValueTags: [ValueTag] {
@@ -49,7 +47,6 @@ public extension MethodMetadata {
4947
}
5048
}
5149

52-
@available(*, deprecated, message: "This API is experimental.")
5350
public extension Module {
5451
/// Executes a specific method with the provided input values.
5552
/// The method is loaded on demand if not already loaded.
@@ -94,7 +91,6 @@ public extension Module {
9491
}
9592
}
9693

97-
@available(*, deprecated, message: "This API is experimental.")
9894
public extension Module {
9995
/// Executes a specific method and decodes the outputs into `Output` generic type.
10096
///
@@ -177,7 +173,6 @@ public extension Module {
177173
}
178174
}
179175

180-
@available(*, deprecated, message: "This API is experimental.")
181176
public extension Module {
182177
/// Sets a single input value for a method at the specified index.
183178
///

extension/apple/ExecuTorch/Exported/ExecuTorch+Tensor.swift

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,118 +12,103 @@
1212
///
1313
/// - Parameter shape: An array of integers, where each element represents a dimension size.
1414
/// - Returns: An integer equal to the product of the sizes of all dimensions.
15-
@available(*, deprecated, message: "This API is experimental.")
1615
public func elementCount(ofShape shape: [Int]) -> Int {
1716
__ExecuTorchElementCountOfShape(shape.map(NSNumber.init))
1817
}
1918

2019
/// A protocol that types conform to in order to be used as tensor element types.
2120
/// Provides the mapping from the Swift type to the underlying `DataType`.
22-
@available(*, deprecated, message: "This API is experimental.")
2321
public protocol Scalar {
2422
/// The `DataType` corresponding to this scalar type.
2523
static var dataType: DataType { get }
2624
/// Converts the scalar to an `NSNumber`.
2725
func asNSNumber() -> NSNumber
2826
}
2927

30-
@available(*, deprecated, message: "This API is experimental.")
3128
extension UInt8: Scalar {
3229
/// The `DataType` corresponding to `UInt8`, which is `.byte`.
3330
public static var dataType: DataType { .byte }
3431
/// Returns the value as an `NSNumber`.
3532
public func asNSNumber() -> NSNumber { NSNumber(value: self) }
3633
}
3734

38-
@available(*, deprecated, message: "This API is experimental.")
3935
extension Int8: Scalar {
4036
/// The `DataType` corresponding to `Int8`, which is `.char`.
4137
public static var dataType: DataType { .char }
4238
/// Returns the value as an `NSNumber`.
4339
public func asNSNumber() -> NSNumber { NSNumber(value: self) }
4440
}
4541

46-
@available(*, deprecated, message: "This API is experimental.")
4742
extension Int16: Scalar {
4843
/// The `DataType` corresponding to `Int16`, which is `.short`.
4944
public static var dataType: DataType { .short }
5045
/// Returns the value as an `NSNumber`.
5146
public func asNSNumber() -> NSNumber { NSNumber(value: self) }
5247
}
5348

54-
@available(*, deprecated, message: "This API is experimental.")
5549
extension Int32: Scalar {
5650
/// The `DataType` corresponding to `Int32`, which is `.int`.
5751
public static var dataType: DataType { .int }
5852
/// Returns the value as an `NSNumber`.
5953
public func asNSNumber() -> NSNumber { NSNumber(value: self) }
6054
}
6155

62-
@available(*, deprecated, message: "This API is experimental.")
6356
extension Int64: Scalar {
6457
/// The `DataType` corresponding to `Int64`, which is `.long`.
6558
public static var dataType: DataType { .long }
6659
/// Returns the value as an `NSNumber`.
6760
public func asNSNumber() -> NSNumber { NSNumber(value: self) }
6861
}
6962

70-
@available(*, deprecated, message: "This API is experimental.")
7163
extension Int: Scalar {
7264
/// The `DataType` corresponding to `Int`, which is `.long`.
7365
public static var dataType: DataType { .long }
7466
/// Returns the value as an `NSNumber`.
7567
public func asNSNumber() -> NSNumber { NSNumber(value: self) }
7668
}
7769

78-
@available(*, deprecated, message: "This API is experimental.")
7970
extension Float: Scalar {
8071
/// The `DataType` corresponding to `Float`, which is `.float`.
8172
public static var dataType: DataType { .float }
8273
/// Returns the value as an `NSNumber`.
8374
public func asNSNumber() -> NSNumber { NSNumber(value: self) }
8475
}
8576

86-
@available(*, deprecated, message: "This API is experimental.")
8777
extension Double: Scalar {
8878
/// The `DataType` corresponding to `Double`, which is `.double`.
8979
public static var dataType: DataType { .double }
9080
/// Returns the value as an `NSNumber`.
9181
public func asNSNumber() -> NSNumber { NSNumber(value: self) }
9282
}
9383

94-
@available(*, deprecated, message: "This API is experimental.")
9584
extension Bool: Scalar {
9685
/// The `DataType` corresponding to `Bool`, which is `.bool`.
9786
public static var dataType: DataType { .bool }
9887
/// Returns the value as an `NSNumber`.
9988
public func asNSNumber() -> NSNumber { NSNumber(value: self) }
10089
}
10190

102-
@available(*, deprecated, message: "This API is experimental.")
10391
extension UInt16: Scalar {
10492
/// The `DataType` corresponding to `UInt16`.
10593
public static var dataType: DataType { .uInt16 }
10694
/// Returns the value as an `NSNumber`.
10795
public func asNSNumber() -> NSNumber { NSNumber(value: self) }
10896
}
10997

110-
@available(*, deprecated, message: "This API is experimental.")
11198
extension UInt32: Scalar {
11299
/// The `DataType` corresponding to `UInt32`.
113100
public static var dataType: DataType { .uInt32 }
114101
/// Returns the value as an `NSNumber`.
115102
public func asNSNumber() -> NSNumber { NSNumber(value: self) }
116103
}
117104

118-
@available(*, deprecated, message: "This API is experimental.")
119105
extension UInt64: Scalar {
120106
/// The `DataType` corresponding to `UInt64`.
121107
public static var dataType: DataType { .uInt64 }
122108
/// Returns the value as an `NSNumber`.
123109
public func asNSNumber() -> NSNumber { NSNumber(value: self) }
124110
}
125111

126-
@available(*, deprecated, message: "This API is experimental.")
127112
extension UInt: Scalar {
128113
/// The `DataType` corresponding to `UInt`.
129114
public static var dataType: DataType { .uInt64 }
@@ -132,7 +117,6 @@ extension UInt: Scalar {
132117
}
133118

134119
/// A type-erasing tensor class for ExecuTorch operations.
135-
@available(*, deprecated, message: "This API is experimental.")
136120
public extension AnyTensor {
137121
/// The shape of the tensor.
138122
var shape: [Int] { __shape.map(\.intValue) }
@@ -258,7 +242,6 @@ public extension AnyTensor {
258242
}
259243
}
260244

261-
@available(*, deprecated, message: "This API is experimental.")
262245
public extension AnyTensor {
263246
/// Creates an empty tensor with the specified properties.
264247
///
@@ -302,7 +285,6 @@ public extension AnyTensor {
302285
}
303286
}
304287

305-
@available(*, deprecated, message: "This API is experimental.")
306288
public extension AnyTensor {
307289
/// Creates a tensor filled with the specified scalar value.
308290
///
@@ -348,7 +330,6 @@ public extension AnyTensor {
348330
}
349331
}
350332

351-
@available(*, deprecated, message: "This API is experimental.")
352333
public extension AnyTensor {
353334
/// Creates a tensor filled with ones.
354335
///
@@ -390,7 +371,6 @@ public extension AnyTensor {
390371
}
391372
}
392373

393-
@available(*, deprecated, message: "This API is experimental.")
394374
public extension AnyTensor {
395375
/// Creates a tensor filled with zeros.
396376
///
@@ -433,7 +413,6 @@ public extension AnyTensor {
433413
}
434414
}
435415

436-
@available(*, deprecated, message: "This API is experimental.")
437416
public extension AnyTensor {
438417
/// Creates a tensor with random values uniformly distributed in `[0, 1)`.
439418
///
@@ -477,7 +456,6 @@ public extension AnyTensor {
477456
}
478457
}
479458

480-
@available(*, deprecated, message: "This API is experimental.")
481459
public extension AnyTensor {
482460
/// Creates a tensor with random values from a normal distribution with mean `0` and variance `1`.
483461
///
@@ -521,7 +499,6 @@ public extension AnyTensor {
521499
}
522500
}
523501

524-
@available(*, deprecated, message: "This API is experimental.")
525502
public extension AnyTensor {
526503
/// Creates a tensor with random integers from `low` (inclusive) to `high` (exclusive).
527504
///
@@ -581,7 +558,6 @@ public extension AnyTensor {
581558
///
582559
/// This class encapsulates a type-erasing `AnyTensor` instance and provides a variety of
583560
/// initializers and utility methods to work with tensor data.
584-
@available(*, deprecated, message: "This API is experimental.")
585561
public final class Tensor<T: Scalar>: Equatable {
586562
/// The data type of the tensor's elements.
587563
public var dataType: DataType { anyTensor.dataType }
@@ -819,7 +795,6 @@ public final class Tensor<T: Scalar>: Equatable {
819795
public let anyTensor: AnyTensor
820796
}
821797

822-
@available(*, deprecated, message: "This API is experimental.")
823798
public extension Tensor {
824799
/// Returns the tensor's elements as an array of scalars.
825800
///
@@ -829,7 +804,6 @@ public extension Tensor {
829804
}
830805
}
831806

832-
@available(*, deprecated, message: "This API is experimental.")
833807
public extension Tensor {
834808
/// Creates an empty tensor with the specified properties.
835809
///
@@ -868,7 +842,6 @@ public extension Tensor {
868842
}
869843
}
870844

871-
@available(*, deprecated, message: "This API is experimental.")
872845
public extension Tensor {
873846
/// Creates a tensor filled with the specified scalar value.
874847
///
@@ -912,7 +885,6 @@ public extension Tensor {
912885
}
913886
}
914887

915-
@available(*, deprecated, message: "This API is experimental.")
916888
public extension Tensor {
917889
/// Creates a tensor filled with ones.
918890
///
@@ -950,7 +922,6 @@ public extension Tensor {
950922
}
951923
}
952924

953-
@available(*, deprecated, message: "This API is experimental.")
954925
public extension Tensor {
955926
/// Creates a tensor filled with zeros.
956927
///
@@ -988,7 +959,6 @@ public extension Tensor {
988959
}
989960
}
990961

991-
@available(*, deprecated, message: "This API is experimental.")
992962
public extension Tensor {
993963
/// Creates a tensor with random values uniformly distributed in `[0, 1)`.
994964
///
@@ -1027,7 +997,6 @@ public extension Tensor {
1027997
}
1028998
}
1029999

1030-
@available(*, deprecated, message: "This API is experimental.")
10311000
public extension Tensor {
10321001
/// Creates a tensor with random values from a normal distribution with mean `0` and variance `1`.
10331002
///
@@ -1066,7 +1035,6 @@ public extension Tensor {
10661035
}
10671036
}
10681037

1069-
@available(*, deprecated, message: "This API is experimental.")
10701038
public extension Tensor {
10711039
/// Creates a tensor with random integers from `low` (inclusive) to `high` (exclusive).
10721040
///
@@ -1117,7 +1085,6 @@ public extension Tensor {
11171085
}
11181086
}
11191087

1120-
@available(*, deprecated, message: "This API is experimental.")
11211088
extension Tensor: CustomStringConvertible {
11221089
public var description: String {
11231090
self.anyTensor.description

0 commit comments

Comments
 (0)