model.stateless_call() performs a model forward pass from explicit trainable and nontrainable weights, inputs, and training arguments. It returns outputs together with updated nontrainable weights, making forward computation compatible with stateless programming. section 7.4.2
Using the method in a JAX loss function
A loss function can call model.stateless_call(), compute the loss, and return both the scalar loss and updated nontrainable variables. Passing this function to jax$value_and_grad(..., has_aux = TRUE) produces gradients while preserving those updates. section 7.4.2
