#NEWLINE# def test_elemmult_grad_4( ) : #NEWLINE# #INDENT# npr . seed ( 15 ) #NEWLINE# for ii in xrange ( NUM_TRIALS ) : #NEWLINE# #INDENT# np_A = npr . randn ( 5 , 6 ) #NEWLINE# A = kayak . Parameter ( np_A ) #NEWLINE# D = kayak . ElemMult ( A , A ) #NEWLINE# E = kayak . MatSum ( D ) #NEWLINE# E . value #NEWLINE# assert ( E . grad ( A ) . shape == E . shape ) #NEWLINE# assert ( kayak . util . checkgrad ( A , E ) < MAX_GRAD_DIFF )