public override apply(parameter as NDArray<T>, gradient as NDArray<T>, gradientScale as Double = 1.0) as Void
Updates a parameter tensor in place: parameter -= learningRate * gradient. Shape errors are detected before any write. Non-finite values follow IEEE arithmetic; finite-gradient/loss-scaling policy belongs to the trainer.
| Parameter | Description |
|---|---|
parameter | Tensor of any rank, modified in place. |
gradientScale | Positive finite loss scale removed before the update. |
gradient | Tensor of the same shape and type, not modified. |
optimizer.apply(layer.weights, derivatives.weights)