pub fn _hessian_vector_product<'graph, A, B, C, F: Float>(
    ys: &[A],
    xs: &[B],
    vectors: &[C],
) -> Vec<Tensor<'graph, F>>
where
    A: AsRef<Tensor<'graph, F>>,
    B: AsRef<Tensor<'graph, F>>,
    C: AsRef<Tensor<'graph, F>>,
{
    let grads = grad(ys, xs);
    let products = grads
        .into_iter()
        .zip(vectors)
        .map(|(g, v)| g.as_ref().clone() * v.as_ref().clone())
        .collect::<Vec<_>>();
    grad(products.as_slice(), xs)
}
/// (Experimental) Computes hessian vector product
(Experimental) Computes hessian vector product
( Experimental ) Computes hessian vector product
pub fn _hessian_vector_product<'graph, A, B, C, F: Float>(
    ys: &[A],
    xs: &[B],
    vectors: &[C],
) -> Vec<Tensor<'graph, F>>
where
    A: AsRef<Tensor<'graph, F>>,
    B: AsRef<Tensor<'graph, F>>,
    C: AsRef<Tensor<'graph, F>>,
{
    let grads = grad(ys, xs);
    let products = grads
        .into_iter()
        .zip(vectors)
        .map(|(g, v)| g.as_ref().clone() * v.as_ref().clone())
        .collect::<Vec<_>>();
    grad(products.as_slice(), xs)
}
pub fn _hessian_vector_product < ' graph , A , B , C , F : Float > ( ys : & [ A ] , xs : & [ B ] , vectors : & [ C ] , ) -> Vec < Tensor < ' graph , F > > where A : AsRef < Tensor < ' graph , F > > , B : AsRef < Tensor < ' graph , F > > , C : AsRef < Tensor < ' graph , F > > , { let grads = grad ( ys , xs ) ; let products = grads . into_iter ( ) . zip ( vectors ) . map ( | ( g , v ) | g . as_ref ( ) . clone ( ) * v . as_ref ( ) . clone ( ) ) . collect :: < Vec < _ > > ( ) ; grad ( products . as_slice ( ) , xs ) }
(Experimental) Computes hessian vector product
( Experimental ) Computes hessian vector product
ys
&[A]
xs
&[B]
vectors
&[C]
ys
&[A]
xs
&[B]
vectors
&[C]