GradScaler
public struct GradScaler
-
Declaration
Swift
public var scale: Float
-
Declaration
Swift
public var growthFactor: Float
-
Declaration
Swift
public var backoffFactor: Float
-
Declaration
Swift
public var growthInterval: Int
-
Declaration
Swift
public init( scale: Float = 65536, growthFactor: Float = 2, backoffFactor: Float = 0.5, growthInterval: Int = 2_000 )
-
Declaration
Swift
public func scale<T: DynamicGraph.TensorGroup>(_ loss: T, streamContext: StreamContext? = nil) -> T
-
Declaration
Swift
public mutating func unscale<T>(_ optimizers: [T], streamContext: StreamContext? = nil) where T : Optimizer
-
Declaration
Swift
public mutating func step<T: Optimizer>( _ optimizers: inout [T], streamContext: StreamContext? = nil )
-
Declaration
Swift
public mutating func unscale<T>(_ optimizer: T, streamContext: StreamContext? = nil) where T : Optimizer
-
Declaration
Swift
public mutating func step<T>(_ optimizer: inout T, streamContext: StreamContext? = nil) where T : Optimizer