// swift-interface-format-version: 1.0 // swift-compiler-version: Apple Swift version 6.3 effective-5.10 (swiftlang-6.3.0.123.4 clang-2100.0.123.2) // swift-module-flags: -target arm64e-apple-macos26.4 -target-variant arm64e-apple-ios26.4-macabi -enable-objc-interop -autolink-force-load -enable-library-evolution -module-link-name swiftMLCompute -swift-version 5 -enforce-exclusivity=checked -O -library-level api -enable-experimental-concurrency -enable-experimental-feature DebugDescriptionMacro -enable-bare-slash-regex -user-module-version 84 -module-name MLCompute // swift-module-flags-ignorable: -formal-cxx-interoperability-mode=off -interface-compiler-version 6.3 @_exported import MLCompute import Swift import _Concurrency import _StringProcessing import _SwiftConcurrencyShims @available(macOS, introduced: 11.0, deprecated: 14.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(iOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(tvOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") extension MLCompute.MLCEmbeddingDescriptor { @inlinable public var embeddingCount: Swift.Int { get { Int(exactly: __embeddingCount)! } } @inlinable public var embeddingDimension: Swift.Int { get { Int(exactly: __embeddingDimension)! } } @inlinable public var paddingIndex: Swift.Int? { get { __paddingIndex.map { Int(exactly: $0)! } } } @inlinable public var maximumNorm: Swift.Float? { get { __maximumNorm.map { Float(exactly: $0)! } } } @inlinable public var pNorm: Swift.Float? { get { __pNorm.map { Float(exactly: $0)! } } } @inlinable convenience public init?(embeddingCount: Swift.Int, embeddingDimension: Swift.Int) { self.init( __embeddingCount: embeddingCount as NSNumber, embeddingDimension: embeddingDimension as NSNumber) } @inlinable convenience public init?(embeddingCount: Swift.Int, embeddingDimension: Swift.Int, paddingIndex: Swift.Int?, maximumNorm: Swift.Float?, pNorm: Swift.Float?, scalesGradientByFrequency: Swift.Bool) { self.init( __embeddingCount: embeddingCount as NSNumber, embeddingDimension: embeddingDimension as NSNumber, paddingIndex: paddingIndex as NSNumber?, maximumNorm: maximumNorm as NSNumber?, pNorm: pNorm as NSNumber?, scalesGradientByFrequency: scalesGradientByFrequency) } } @available(macOS, introduced: 11.0, deprecated: 14.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(iOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(tvOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") extension MLCompute.MLCPaddingLayer { @inlinable convenience public init(reflectionPadding: [Swift.Int]) { self.init(__reflectionPadding: reflectionPadding as [NSNumber]) } @inlinable convenience public init(symmetricPadding: [Swift.Int]) { self.init(__symmetricPadding: symmetricPadding as [NSNumber]) } @inlinable convenience public init(zeroPadding: [Swift.Int]) { self.init(__zeroPadding: zeroPadding as [NSNumber]) } @inlinable convenience public init(constantPadding: [Swift.Int], constantValue: Swift.Float) { self.init(__constantPadding: constantPadding as [NSNumber], constantValue: constantValue) } } @available(macOS, introduced: 11.0, deprecated: 14.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(iOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(tvOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") extension MLCompute.MLCLayerNormalizationLayer { @inlinable public var normalizedShape: [Swift.Int] { get { __normalizedShape.map { Int(exactly: $0)! } } } @inlinable convenience public init?(normalizedShape: [Swift.Int], beta: MLCompute.MLCTensor, gamma: MLCompute.MLCTensor, varianceEpsilon: Swift.Float) { self.init( __normalizedShape: normalizedShape as [NSNumber], beta: beta, gamma: gamma, varianceEpsilon: varianceEpsilon) } @available(macOS, introduced: 11.3, deprecated: 14.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(iOS, introduced: 14.5, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(tvOS, introduced: 14.5, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @inlinable convenience public init?(normalizedShape: [Swift.Int], beta: MLCompute.MLCTensor?, gamma: MLCompute.MLCTensor?, varianceEpsilon: Swift.Float) { self.init( __normalizedShape: normalizedShape as [NSNumber], beta: beta, gamma: gamma, varianceEpsilon: varianceEpsilon) } } @available(macOS, introduced: 12.0, deprecated: 14.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(iOS, introduced: 15.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(tvOS, introduced: 15.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") extension MLCompute.MLCInferenceGraph { @discardableResult public func execute(inputsData: [Swift.String : MLCompute.MLCTensorData], lossLabelsData: [Swift.String : MLCompute.MLCTensorData]? = nil, lossLabelWeightsData: [Swift.String : MLCompute.MLCTensorData]? = nil, outputsData: [Swift.String : MLCompute.MLCTensorData]? = nil, batchSize: Swift.Int, options: MLCompute.MLCExecutionOptions = []) async throws -> (result: MLCompute.MLCTensor?, executionTime: Foundation.TimeInterval) } @available(macOS, introduced: 12.0, deprecated: 14.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(iOS, introduced: 15.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(tvOS, introduced: 15.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") extension MLCompute.MLCTrainingGraph { @discardableResult public func executeForward(batchSize: Swift.Int, options: MLCompute.MLCExecutionOptions = [], outputsData: [Swift.String : MLCompute.MLCTensorData]? = nil) async throws -> (result: MLCompute.MLCTensor?, executionTime: Foundation.TimeInterval) @discardableResult public func executeGradient(batchSize: Swift.Int, options: MLCompute.MLCExecutionOptions = [], outputsData: [Swift.String : MLCompute.MLCTensorData]? = nil) async throws -> Foundation.TimeInterval @discardableResult public func executeOptimizerUpdate(options: MLCompute.MLCExecutionOptions = []) async throws -> Foundation.TimeInterval } @available(macOS, introduced: 11.0, deprecated: 14.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(iOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(tvOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") extension MLCompute.MLCSplitLayer { @inlinable public var splitSectionLengths: [Swift.Int]? { get { __splitSectionLengths?.map { Int(exactly: $0)! } } } @inlinable convenience public init(splitSectionLengths: [Swift.Int], dimension: Swift.Int) { self.init( __splitSectionLengths: splitSectionLengths as [NSNumber], dimension: dimension) } } @available(macOS, introduced: 11.0, deprecated: 14.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(iOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(tvOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") extension MLCompute.MLCUpsampleLayer { @inlinable public var shape: [Swift.Int] { get { __shape.map { Int(exactly: $0)! } } } @inlinable convenience public init?(shape: [Swift.Int]) { self.init(__shape: shape as [NSNumber]) } @inlinable convenience public init?(shape: [Swift.Int], sampleMode: MLCompute.MLCSampleMode, alignsCorners: Swift.Bool) { self.init( __shape: shape as [NSNumber], sampleMode: sampleMode, alignsCorners: alignsCorners) } } @available(macOS, introduced: 11.0, deprecated: 14.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(iOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(tvOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") extension MLCompute.MLCSliceLayer { @inlinable public var start: [Swift.Int] { get { __start.map { Int(exactly: $0)! } } } @inlinable public var end: [Swift.Int] { get { __end.map { Int(exactly: $0)! } } } @inlinable public var stride: [Swift.Int]? { get { __stride?.map { Int(exactly: $0)! } } } @inlinable convenience public init?(start: [Swift.Int], end: [Swift.Int], stride: [Swift.Int]?) { self.init( __start: start as [NSNumber], end: end as [NSNumber], stride: stride as [NSNumber]?) } } @available(macOS, introduced: 11.0, deprecated: 14.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(iOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(tvOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") extension MLCompute.MLCConvolutionDescriptor { @inlinable public var kernelSizes: (height: Swift.Int, width: Swift.Int) { get { (__kernelHeight, __kernelWidth) } } @inlinable public var strides: (y: Swift.Int, x: Swift.Int) { get { (__strideInY, __strideInX) } } @inlinable public var dilationRates: (y: Swift.Int, x: Swift.Int) { get { (__dilationRateInY, __dilationRateInX) } } @inlinable public var paddingPolicy: MLCompute.MLCPaddingPolicy { get { switch __paddingPolicy { case .same: return .same case .valid: return .valid case .usePaddingSize: return .sized(y: __paddingSizeInY, x: __paddingSizeInX) @unknown default: fatalError("Internal error: Unhandled case in Swift overlay") } } } @inlinable convenience public init(type: MLCompute.MLCConvolutionType = .standard, kernelSizes: (height: Swift.Int, width: Swift.Int), inputFeatureChannelCount: Swift.Int, outputFeatureChannelCount: Swift.Int, groupCount: Swift.Int = 1, strides: (y: Swift.Int, x: Swift.Int) = (1, 1), dilationRates: (y: Swift.Int, x: Swift.Int) = (1, 1), paddingPolicy: MLCompute.MLCPaddingPolicy = .same) { self.init( __type: type, kernelSizes: [kernelSizes.height, kernelSizes.width] as [NSNumber], inputFeatureChannelCount: inputFeatureChannelCount, outputFeatureChannelCount: outputFeatureChannelCount, groupCount: groupCount, strides: [strides.y, strides.x] as [NSNumber], dilationRates: [dilationRates.y, dilationRates.x] as [NSNumber], paddingPolicy: paddingPolicy.objcPolicy, paddingSizes: paddingPolicy.objcSizes) } } @available(macOS, introduced: 11.3, deprecated: 14.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(iOS, introduced: 14.5, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(tvOS, introduced: 14.5, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") extension MLCompute.MLCReductionLayer { @inlinable public var dimensions: [Swift.Int] { get { __dimensions.map { Int(exactly: $0)! } } } @inlinable convenience public init?(reductionType: MLCompute.MLCReductionType, dimensions: [Swift.Int]) { self.init(__reductionType: reductionType, dimensions: dimensions as [NSNumber]) } } @available(macOS, introduced: 11.0, deprecated: 14.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(iOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(tvOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") extension MLCompute.MLCTransposeLayer { @inlinable public var dimensions: [Swift.Int] { get { __dimensions.map { Int(exactly: $0)! } } } @inlinable convenience public init?(dimensions: [Swift.Int]) { self.init(__dimensions: dimensions as [NSNumber]) } } @available(macOS, introduced: 11.0, deprecated: 14.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(iOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(tvOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") public enum MLCPaddingPolicy { case same case valid case sized(y: Swift.Int, x: Swift.Int) @inlinable internal var objcPolicy: MLCompute.__MLCPaddingPolicy { get { switch self { case .same: return .same case .valid: return .valid case .sized: return .usePaddingSize @unknown default: fatalError("Internal error: Unhandled case in Swift overlay") } } } @inlinable internal var objcSizes: [Foundation.NSNumber]? { get { guard case let .sized(y, x) = self else { return nil } return [y, x] as [NSNumber] } } @inlinable public var debugDescription: Swift.String { get { let objcDescription = __MLCPaddingPolicyDebugDescription(objcPolicy) switch self { case .same, .valid: return objcDescription case let .sized(y, x): return objcDescription + " (y: \(y), x: \(x))" @unknown default: fatalError("Internal error: Unhandled case in Swift overlay") } } } } @available(macOS, introduced: 11.0, deprecated: 14.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(iOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(tvOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") extension MLCompute.MLCTensor { @inlinable convenience public init(shape: [Swift.Int]) { self.init(__shape: shape as [NSNumber]) } @inlinable convenience public init(shape: [Swift.Int], randomInitializerType: MLCompute.MLCRandomInitializerType) { self.init(__shape: shape as [NSNumber], randomInitializerType: randomInitializerType) } @inlinable convenience public init(shape: [Swift.Int], dataType: MLCompute.MLCDataType) { self.init(__shape: shape as [NSNumber], dataType: dataType) } @inlinable convenience public init(shape: [Swift.Int], data: MLCompute.MLCTensorData, dataType: MLCompute.MLCDataType) { self.init(__shape: shape as [NSNumber], data: data, dataType: dataType) } @inlinable convenience public init(shape: [Swift.Int], fillWithData fillData: Foundation.NSNumber, dataType: MLCompute.MLCDataType) { self.init(__shape: shape as [NSNumber], fillWithData: fillData, dataType: dataType) } @inlinable convenience public init?(sequenceLengths: [Swift.Int], sortedSequences: Swift.Bool, featureChannelCount: Swift.Int, batchSize: Swift.Int, randomInitializerType: MLCompute.MLCRandomInitializerType) { self.init( __sequenceLengths: sequenceLengths as [NSNumber], sortedSequences: sortedSequences, featureChannelCount: featureChannelCount, batchSize: batchSize, randomInitializerType: randomInitializerType ) } @inlinable convenience public init?(sequenceLengths: [Swift.Int], sortedSequences: Swift.Bool, featureChannelCount: Swift.Int, batchSize: Swift.Int, data: MLCompute.MLCTensorData? = nil) { self.init( __sequenceLengths: sequenceLengths as [NSNumber], sortedSequences: sortedSequences, featureChannelCount: featureChannelCount, batchSize: batchSize, data: data ) } } @available(macOS, introduced: 11.0, deprecated: 14.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(iOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(tvOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") extension MLCompute.MLCGraph { @inlinable public func split(source: MLCompute.MLCTensor, splitSectionLengths: [Swift.Int], dimension: Swift.Int) -> [MLCompute.MLCTensor]? { __split( withSource: source, splitSectionLengths: splitSectionLengths as [NSNumber], dimension: dimension) } @inlinable public func reshape(shape: [Swift.Int], source: MLCompute.MLCTensor) -> MLCompute.MLCTensor? { __reshape(withShape: shape as [NSNumber], source: source) } @inlinable public func transpose(dimensions: [Swift.Int], source: MLCompute.MLCTensor) -> MLCompute.MLCTensor? { __transpose(withDimensions: dimensions as [NSNumber], source: source) } } @available(macOS, introduced: 11.0, deprecated: 14.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(iOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(tvOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") extension MLCompute.MLCReshapeLayer { @inlinable convenience public init?(shape: [Swift.Int]) { self.init(__shape: shape as [NSNumber]) } } @available(macOS, introduced: 11.3, deprecated: 14.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(iOS, introduced: 14.5, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(tvOS, introduced: 14.5, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") extension MLCompute.MLCReshapeLayer { @inlinable public var shape: [Swift.Int] { get { __shape.map { Int(exactly: $0)! } } } } @available(macOS, introduced: 11.0, deprecated: 14.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(iOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(tvOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") extension MLCompute.MLCTensorDescriptor { @inlinable public var shape: [Swift.Int] { get { __shape.map { Int(exactly: $0)! } } } @inlinable public var stride: [Swift.Int] { get { __stride.map { Int(exactly: $0)! } } } @inlinable public var sequenceLengths: [Swift.Int]? { get { __sequenceLengths?.map { Int(exactly: $0)! } } } @inlinable public var batchSizePerSequenceStep: [Swift.Int]? { get { __batchSizePerSequenceStep?.map { Int(exactly: $0)! } } } @inlinable convenience public init?(shape: [Swift.Int], dataType: MLCompute.MLCDataType) { self.init(__shape: shape as [NSNumber], dataType: dataType) } @inlinable convenience public init?(shape: [Swift.Int], sequenceLengths: [Swift.Int], sortedSequences: Swift.Bool, dataType: MLCompute.MLCDataType) { self.init( __shape: shape as [NSNumber], sequenceLengths: sequenceLengths as [NSNumber], sortedSequences: sortedSequences, dataType: dataType) } } @available(macOS, introduced: 11.0, deprecated: 14.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(iOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(tvOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") public enum MLCPoolingType { case max case average(countIncludesPadding: Swift.Bool = false) case l2Norm @inlinable internal var objcPoolingType: MLCompute.__MLCPoolingType { get { switch self { case .max: return .max case .average(_): return .average case .l2Norm: return .l2Norm @unknown default: fatalError("Internal error: Unhandled case in Swift overlay") } } } @inlinable public var debugDescription: Swift.String { get { let objcDescription = __MLCPoolingTypeDebugDescription(objcPoolingType) switch self { case .max: return objcDescription case .average(let countIncludesPadding): return objcDescription + "(Count includes padding: \(countIncludesPadding))" case .l2Norm: return objcDescription @unknown default: fatalError("Internal error: Unhandled case in Swift overlay") } } } } @available(macOS, introduced: 11.0, deprecated: 14.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(iOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") @available(tvOS, introduced: 14.0, deprecated: 17.0, message: "Use Metal Performance Shaders Graph or BNNS instead.") extension MLCompute.MLCPoolingDescriptor { @inlinable public var poolingType: MLCompute.MLCPoolingType { get { switch __poolingType { case .max: return .max case .average: return .average(countIncludesPadding: __countIncludesPadding) case .l2Norm: return .l2Norm @unknown default: fatalError("Internal error: Unhandled case in Swift overlay") } } } @inlinable public var kernelSizes: (height: Swift.Int, width: Swift.Int) { get { (__kernelHeight, __kernelWidth) } } @inlinable public var strides: (y: Swift.Int, x: Swift.Int) { get { (__strideInY, __strideInX) } } @inlinable public var dilationRates: (y: Swift.Int, x: Swift.Int) { get { (__dilationRateInY, __dilationRateInX) } } @inlinable public var paddingPolicy: MLCompute.MLCPaddingPolicy { get { switch __paddingPolicy { case .same: return .same case .valid: return .valid case .usePaddingSize: return .sized(y: __paddingSizeInY, x: __paddingSizeInX) @unknown default: fatalError("Internal error: Unhandled case in Swift overlay") } } } @inlinable convenience public init(type: MLCompute.MLCPoolingType, kernelSizes: (height: Swift.Int, width: Swift.Int), strides: (y: Swift.Int, x: Swift.Int) = (y: 1, x: 1), dilationRates: (y: Swift.Int, x: Swift.Int) = (y: 1, x: 1), paddingPolicy: MLCompute.MLCPaddingPolicy = .same) { switch type { case .max: self.init( __maxPoolingWithKernelSizes: [kernelSizes.height, kernelSizes.width] as [NSNumber], strides: [strides.y, strides.x] as [NSNumber], dilationRates: [dilationRates.y, dilationRates.x] as [NSNumber], paddingPolicy: paddingPolicy.objcPolicy, paddingSizes: paddingPolicy.objcSizes) case let .average(countIncludesPadding): self.init( __averagePoolingWithKernelSizes: [kernelSizes.height, kernelSizes.width] as [NSNumber], strides: [strides.y, strides.x] as [NSNumber], dilationRates: [dilationRates.y, dilationRates.x] as [NSNumber], paddingPolicy: paddingPolicy.objcPolicy, paddingSizes: paddingPolicy.objcSizes, countIncludesPadding: countIncludesPadding) case .l2Norm: self.init( __l2NormPoolingWithKernelSizes: [kernelSizes.height, kernelSizes.width] as [NSNumber], strides: [strides.y, strides.x] as [NSNumber], dilationRates: [dilationRates.y, dilationRates.x] as [NSNumber], paddingPolicy: paddingPolicy.objcPolicy, paddingSizes: paddingPolicy.objcSizes) @unknown default: fatalError("Internal error: Unhandled case in Swift overlay") } } }