func lossAndGradient(for input: Tensor<Float>, using model: IrisParameters, labels: Tensor<Int32>) -> (Float, IrisParameters) { let (loss, (_, modelGrad)) = #valueAndGradient(loss(for:using:labels:), wrt: .0, .1)(input, model, labels) return (loss, modelGrad) }