#NEWLINE# def test_matrix_jacobian_product( ) : #NEWLINE# #INDENT# fun = ( lambda a : np . roll ( np . sin ( a ) , 1 ) ) #NEWLINE# a = npr . randn ( 5 , 4 ) #NEWLINE# V = npr . randn ( 5 , 4 ) #NEWLINE# J = jacobian ( fun ) ( a ) #NEWLINE# check_equivalent ( np . tensordot ( V , J ) , vector_jacobian_product ( fun ) ( a , V ) )