AnyModelBuilder
public class AnyModelBuilder : AnyModel
A type-erased model builder.
-
Declaration
Swift
public var testing: Bool { get set }
-
Whether to enable memory reduction for this model. The current supported memory reduction technique is to redo datatype conversion during backward pass if needed.
Declaration
Swift
public var memoryReduction: Bool { get set }
-
Specify the maximum number of streams we need to allocate to run this model.
Declaration
Swift
public var maxConcurrency: StreamContext.Concurrency { get set }
-
Abstract representation of the stateful components from the model builder.
Declaration
Swift
public var parameters: Model.Parameters { get }
-
Shortcut for weight parameter.
Declaration
Swift
public var weight: Model.Parameters { get }
-
Shortcut for bias parameter.
Declaration
Swift
public var bias: Model.Parameters { get }
-
Broadly speaking, you can have two types of parameters, weight and bias. You can get them in abstract fashion with this method.
Parameters
type
Whether it is weight or bias.
Return Value
An abstract representation of parameters.
-
Cancel current evaluation of this model. It only cancels the model that you know is currently in evaluation, if you didn’t get the execution order right, it won’t have effect (you need to make sure this method, if it is called, is strictly after call to callAsFunction and before it returns).
Declaration
Swift
public func cancel()