SwiftstructNeuralNetworks

struct NeuralNetworks.Function

Structure

What a query’s scopes step through. Every node here can be matched — see the syntax.

Members 21

  1. funcstatic load(from: Foundation.URL, options: NeuralNetworks.CompilationOptions) throws -> (function: NeuralNetworks.Function<[String : NeuralNetworks.Tensor], [String : NeuralNetworks.Tensor]>, parameters: [String : NeuralNetworks.Tensor], states: [String : NeuralNetworks.Tensor])
  2. fieldvar backwardPass: NeuralNetworks.Function<A, B>.ComputePass?+0x8
  3. fieldvar forwardPass: NeuralNetworks.Function<A, B>.ComputePass+0x0
  4. fieldlet inputParser: NeuralNetworks.FunctionInputParser<A>+0x10
  5. fieldlet outputParser: NeuralNetworks.FunctionOutputParser<B>+0x18
  6. funccallAsFunction(_: A, parameters: [String : NeuralNetworks.Tensor], states: inout [String : NeuralNetworks.Tensor]) -> B
  7. funccallAsFunction(_: A, parameters: [String : NeuralNetworks.Tensor]) -> B
  8. funcNeuralNetworks.Function< where B: Collection, B.Element == NeuralNetworks.Tensor>.tensorProperties(forOutputAt: Int) -> (shape: NeuralNetworks.TensorShape, scalarType: NeuralNetworks.TensorScalar.Type)
  9. funcNeuralNetworks.Function< where B: Collection, B: ExpressibleByDictionaryLiteral, B.Sequence.Element == (key: B.ExpressibleByDictionaryLiteral.Key, value: NeuralNetworks.Tensor), B.ExpressibleByDictionaryLiteral.Key: CustomStringConvertible, B.ExpressibleByDictionaryLiteral.Value == NeuralNetworks.Tensor>.tensorProperties(forOutputAt: Int) -> (shape: NeuralNetworks.TensorShape, scalarType: NeuralNetworks.TensorScalar.Type)
  10. funcNeuralNetworks.Function< where B: Collection, B: ExpressibleByDictionaryLiteral, B.Sequence.Element == (key: B.ExpressibleByDictionaryLiteral.Key, value: NeuralNetworks.Tensor), B.ExpressibleByDictionaryLiteral.Key: CustomStringConvertible, B.ExpressibleByDictionaryLiteral.Value == NeuralNetworks.Tensor>.tensorProperties(forOutputNamed: String) -> (shape: NeuralNetworks.TensorShape, scalarType: NeuralNetworks.TensorScalar.Type)?
  11. funcNeuralNetworks.Function< where A: Collection, A.Element == NeuralNetworks.Tensor>.tensorProperties(forInputAt: Int) -> (shape: NeuralNetworks.TensorShape, scalarType: NeuralNetworks.TensorScalar.Type)
  12. funcNeuralNetworks.Function< where A: Collection, A: ExpressibleByDictionaryLiteral, A.Sequence.Element == (key: A.ExpressibleByDictionaryLiteral.Key, value: NeuralNetworks.Tensor), A.ExpressibleByDictionaryLiteral.Key: CustomStringConvertible, A.ExpressibleByDictionaryLiteral.Value == NeuralNetworks.Tensor>.tensorProperties(forInputAt: Int) -> (shape: NeuralNetworks.TensorShape, scalarType: NeuralNetworks.TensorScalar.Type)
  13. funcNeuralNetworks.Function< where A: Collection, A: ExpressibleByDictionaryLiteral, A.Sequence.Element == (key: A.ExpressibleByDictionaryLiteral.Key, value: NeuralNetworks.Tensor), A.ExpressibleByDictionaryLiteral.Key: CustomStringConvertible, A.ExpressibleByDictionaryLiteral.Value == NeuralNetworks.Tensor>.tensorProperties(forInputNamed: String) -> (shape: NeuralNetworks.TensorShape, scalarType: NeuralNetworks.TensorScalar.Type)?
  14. varvar customMirror: Mirror { get }
  15. varvar description: String { get }
  16. varvar inputCount: Int { get }
  17. varvar inputNames: [String] { get }
  18. varvar inputTensorProperties: (shape: NeuralNetworks.TensorShape, scalarType: NeuralNetworks.TensorScalar.Type) { get }
  19. varvar outputCount: Int { get }
  20. varvar outputNames: [String] { get }
  21. varvar outputTensorProperties: (shape: NeuralNetworks.TensorShape, scalarType: NeuralNetworks.TensorScalar.Type) { get }
struct Function<A, B> {
    class ComputePass {
        let inputMappings: [NeuralNetworks.Function<A, B>.IOMapping]
        let outputMappings: [NeuralNetworks.Function<A, B>.IOMapping]
        var computeDevice: NeuralNetworks.ComputeDevice
        let function: NeuralNetworks.LazyTensorFunction
        var _executor: (any NeuralNetworks.LazyTensorFunctionExecutor)?
    }
    class Operation {
        let id: NeuralNetworks.TensorOperationID
        let backward: (([NeuralNetworks.OutputGradient], [NeuralNetworks.Tensor]) -> [NeuralNetworks.InputGradient])?
        let creationSite: NeuralNetworks.SourceLocation?
        var inputs: [NeuralNetworks.TensorRepresentation]
        var differentiableOperands: [NeuralNetworks.TensorRepresentation]
        let outputs: [NeuralNetworks.TensorRepresentation]
    }
    struct IOMapping {
        enum Kind {
            case input
            case parameter
            case state
            case output
        }
        let kind: NeuralNetworks.Function<A, B>.IOMapping.Kind
        let userKey: Swift.String
        let functionKey: Swift.String
        let functionIndex: Swift.Int
    }
    struct CompilationError {
        let description: Swift.String
    }
    var forwardPass: NeuralNetworks.Function<A, B>.ComputePass
    var backwardPass: NeuralNetworks.Function<A, B>.ComputePass?
    let inputParser: NeuralNetworks.FunctionInputParser<A>
    let outputParser: NeuralNetworks.FunctionOutputParser<B>

    var customMirror: Swift.Mirror {
        get
    }
    var description: Swift.String {
        get
    }

    func callAsFunction(_: A, parameters: [Swift.String : NeuralNetworks.Tensor], states: inout [Swift.String : NeuralNetworks.Tensor]) -> B
    func callAsFunction(_: A, parameters: [Swift.String : NeuralNetworks.Tensor]) -> B

    static func load(from: Foundation.URL, options: NeuralNetworks.CompilationOptions) throws -> (function: NeuralNetworks.Function<[Swift.String : NeuralNetworks.Tensor], [Swift.String : NeuralNetworks.Tensor]>, parameters: [Swift.String : NeuralNetworks.Tensor], states: [Swift.String : NeuralNetworks.Tensor])
}