#NEWLINE# def test_hessian_matrix_product( ) : #NEWLINE# #INDENT# fun = ( lambda a : np . sum ( np . sin ( a ) ) ) #NEWLINE# a = npr . randn ( 5 , 4 ) #NEWLINE# V = npr . randn ( 5 , 4 ) #NEWLINE# H = hessian ( fun ) ( fun ) #NEWLINE# check_equivalent ( np . tensordot ( H , V ) , hessian_vector_product ( fun ) ( a , V ) )