#NEWLINE# def eval_update_gradients( self , function , partial , **kwargs ) : #NEWLINE# #INDENT# self . eval_update_cache ( ** kwargs ) #NEWLINE# gradient = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for theta in partial . variables [ 'theta' ] : #NEWLINE# #INDENT# code = self . code [ function ] [ 'derivative' ] [ theta . name ] #NEWLINE# gradient [ theta . name ] = ( partial * eval ( code , self . namespace ) ) . sum ( ) #NEWLINE# #UNINDENT# return gradient