public protocol KeyPathIterable : _KeyPathIterableBase
A type whose values provides custom key paths to properties or elements.
-
A type that can represent a collection of all key paths of this type.
Declaration
associatedtype AllKeyPaths: Collection where AllKeyPaths.Element == PartialKeyPath<Self>
-
A collection of all custom key paths of this value.
Declaration
var allKeyPaths: AllKeyPaths { get }
-
move(to:)
Recursively copies all
CopyableToDevice
-conforming nested properties and elements to the givenDevice
in-place.Declaration
public mutating mutating func move(to device: Device)
-
init(copying:to:)
Creates a copy of
self
with allCopyableToDevice
-conforming nested properties and elements copied to the givenDevice
.Declaration
public init(copying other: Self, to device: Device)
-
crossReplicaSum(_:)
Runs a cross replica sum over all of the tensors found through key path iteration.
Declaration
public mutating mutating func crossReplicaSum(_ scale: Double)
-
recursivelyAllKeyPaths
An array of all custom key paths of this value and any custom key paths nested within each of what this value’s key paths refers to.
Declaration
var recursivelyAllKeyPaths: [PartialKeyPath<Self>] { get }
-
allKeyPaths(to:)
Returns an array of all custom key paths of this value, to the specified type.
Declaration
func allKeyPaths<T>(to _: T.Type) -> [KeyPath<Self, T>]
-
recursivelyAllKeyPaths(to:)
Returns an array of all custom key paths of this value and any custom key paths nested within each of what this value’s key paths refers to, to the specified type.
Declaration
func recursivelyAllKeyPaths<T>(to _: T.Type) -> [KeyPath<Self, T>]
-
allWritableKeyPaths(to:)
Returns an array of all custom writable key paths of this value, to the specified type.
Declaration
func allWritableKeyPaths<T>(to _: T.Type) -> [WritableKeyPath<Self, T>]
-
recursivelyAllWritableKeyPaths(to:)
Returns an array of all custom writable key paths of this value and any custom writable key paths nested within each of what this value’s key paths refers to, to the specified type.
Declaration
func recursivelyAllWritableKeyPaths<T>( to _: T.Type ) -> [WritableKeyPath<Self, T>]