#NEWLINE# def abs_rel_errors( self , g_pt ) : #NEWLINE# #INDENT# 'Return the abs and rel error of gradient estimate `g_pt`\n\n        `g_pt` must be a list of ndarrays of the same length as self.gf,\n        otherwise a ValueError is raised.\n\n        Corresponding ndarrays in `g_pt` and `self.gf` must have the same\n        shape or ValueError is raised.\n\n        ' #NEWLINE# if ( len ( g_pt ) != len ( errs . gf ) ) : #NEWLINE# #INDENT# raise ValueError ( 'argument has wrong number of elements' , len ( g_pt ) ) #NEWLINE# #UNINDENT# errs = [ ] #NEWLINE# for ( i , ( a , b ) ) in enumerate ( zip ( g_pt , self . gf ) ) : #NEWLINE# #INDENT# if ( a . shape != b . shape ) : #NEWLINE# #INDENT# raise ValueError ( ( 'argument element %i has wrong shape %s' % ( i , str ( ( a . shape , b . shape ) ) ) ) ) #NEWLINE# #UNINDENT# errs . append ( numeric_grad . abs_rel_err ( a , b ) ) #NEWLINE# #UNINDENT# return errs