#NEWLINE# def test_matmult_grad_2( ) : #NEWLINE# #INDENT# npr . seed ( 4 ) #NEWLINE# for ii in xrange ( NUM_TRIALS ) : #NEWLINE# #INDENT# np_A = npr . randn ( 5 , 5 ) #NEWLINE# A = kayak . Parameter ( np_A ) #NEWLINE# C = kayak . MatMult ( A , D ) #NEWLINE# D = kayak . MatSum ( C ) #NEWLINE# D . value #NEWLINE# assert ( D . grad ( A ) . shape == ( 5 , 5 ) ) #NEWLINE# assert ( kayak . util . checkgrad ( A , D ) < MAX_GRAD_DIFF )