Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 0 additions & 5 deletions extension/apple/ExecuTorch/Exported/ExecuTorch+Module.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

@_exported import ExecuTorch

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

@available(*, deprecated, message: "This API is experimental.")
public extension MethodMetadata {
/// The declared input tags.
var inputValueTags: [ValueTag] {
Expand Down Expand Up @@ -49,7 +47,6 @@ public extension MethodMetadata {
}
}

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

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

@available(*, deprecated, message: "This API is experimental.")
public extension Module {
/// Sets a single input value for a method at the specified index.
///
Expand Down
33 changes: 0 additions & 33 deletions extension/apple/ExecuTorch/Exported/ExecuTorch+Tensor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,118 +12,103 @@
///
/// - Parameter shape: An array of integers, where each element represents a dimension size.
/// - Returns: An integer equal to the product of the sizes of all dimensions.
@available(*, deprecated, message: "This API is experimental.")
public func elementCount(ofShape shape: [Int]) -> Int {
__ExecuTorchElementCountOfShape(shape.map(NSNumber.init))
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@available(*, deprecated, message: "This API is experimental.")
public extension AnyTensor {
/// Creates an empty tensor with the specified properties.
///
Expand Down Expand Up @@ -302,7 +285,6 @@ public extension AnyTensor {
}
}

@available(*, deprecated, message: "This API is experimental.")
public extension AnyTensor {
/// Creates a tensor filled with the specified scalar value.
///
Expand Down Expand Up @@ -348,7 +330,6 @@ public extension AnyTensor {
}
}

@available(*, deprecated, message: "This API is experimental.")
public extension AnyTensor {
/// Creates a tensor filled with ones.
///
Expand Down Expand Up @@ -390,7 +371,6 @@ public extension AnyTensor {
}
}

@available(*, deprecated, message: "This API is experimental.")
public extension AnyTensor {
/// Creates a tensor filled with zeros.
///
Expand Down Expand Up @@ -433,7 +413,6 @@ public extension AnyTensor {
}
}

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

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

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

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

@available(*, deprecated, message: "This API is experimental.")
public extension Tensor {
/// Creates an empty tensor with the specified properties.
///
Expand Down Expand Up @@ -868,7 +842,6 @@ public extension Tensor {
}
}

@available(*, deprecated, message: "This API is experimental.")
public extension Tensor {
/// Creates a tensor filled with the specified scalar value.
///
Expand Down Expand Up @@ -912,7 +885,6 @@ public extension Tensor {
}
}

@available(*, deprecated, message: "This API is experimental.")
public extension Tensor {
/// Creates a tensor filled with ones.
///
Expand Down Expand Up @@ -950,7 +922,6 @@ public extension Tensor {
}
}

@available(*, deprecated, message: "This API is experimental.")
public extension Tensor {
/// Creates a tensor filled with zeros.
///
Expand Down Expand Up @@ -988,7 +959,6 @@ public extension Tensor {
}
}

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

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

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

@available(*, deprecated, message: "This API is experimental.")
extension Tensor: CustomStringConvertible {
public var description: String {
self.anyTensor.description
Expand Down
Loading
Loading