fn update<'g, A, B>(&self, variables: &[A], grads: &[B], g: &'g Context<F>, feeder: Feeder<F>)
    where
        A: AsRef<Tensor<'g, F>> + Copy,
        B: AsRef<Tensor<'g, F>> + Copy,
    {
        let mut evaluator = g.evaluator();
        evaluator.set_feeder(feeder);
        // get updates
        let update_ops = self.compute_updates(variables, grads, g);
        evaluator
            .extend(&update_ops)
            .run() // update runs
            .into_iter()
            .for_each(|r| {
                r.unwrap();
            });
    }
/// Runs the graph and updates the variable arrays.
///
/// Updates `variables` destructively.
Runs the graph and updates the variable arrays.
Updates `variables` destructively.
Runs the graph and updates the variable arrays . Updates ` variables ` destructively .
fn update<'g, A, B>(&self, variables: &[A], grads: &[B], g: &'g Context<F>, feeder: Feeder<F>)
    where
        A: AsRef<Tensor<'g, F>> + Copy,
        B: AsRef<Tensor<'g, F>> + Copy,
    {
        let mut evaluator = g.evaluator();
        evaluator.set_feeder(feeder);
        // get updates
        let update_ops = self.compute_updates(variables, grads, g);
        evaluator
            .extend(&update_ops)
            .run() // update runs
            .into_iter()
            .for_each(|r| {
                r.unwrap();
            });
    }
fn update < ' g , A , B > ( & self , variables : & [ A ] , grads : & [ B ] , g : & ' g Context < F > , feeder : Feeder < F > ) where A : AsRef < Tensor < ' g , F > > + Copy , B : AsRef < Tensor < ' g , F > > + Copy , { let mut evaluator = g . evaluator ( ) ; evaluator . set_feeder ( feeder ) ; // get updates let update_ops = self . compute_updates ( variables , grads , g ) ; evaluator . extend ( & update_ops ) . run ( ) // update runs . into_iter ( ) . for_each ( | r | { r . unwrap ( ) ; } ) ; }
Runs the graph and updates the variable arrays.
Runs the graph and updates the variable arrays .
&self
variables
&[A]
grads
&[B]
g
&'g Context<F>
feeder
Feeder<F>
&self
variables
&[A]
grads
&[B]
g
&'g Context<F>
feeder
Feeder<F>