#NEWLINE# def check_rtol( self , x , y ) : #NEWLINE# #INDENT# x_cpu = cuda . to_cpu ( x ) #NEWLINE# y_cpu = cuda . to_cpu ( y ) #NEWLINE# max_ratio = numpy . max ( ( numpy . abs ( ( x_cpu - y_cpu ) ) / x_cpu ) ) #NEWLINE# with self . assertRaises ( AssertionError ) : #NEWLINE# #INDENT# gradient_check . assert_allclose ( x , y , atol = 0 , rtol = ( max_ratio - 1 ) ) #NEWLINE# #UNINDENT# gradient_check . assert_allclose ( x , y , atol = 0 , rtol = ( max_ratio + 1 ) )