#NEWLINE# def test_true_div( self ) : #NEWLINE# #INDENT# x_range = list ( range ( ( - 127 ) , 128 ) ) #NEWLINE# y_range = ( list ( range ( ( - 127 ) , 0 ) ) + list ( range ( 1 , 127 ) ) ) #NEWLINE# xi = int8 ( 'xi' ) #NEWLINE# yi = int8 ( 'yi' ) #NEWLINE# xf = Scalar ( theano . config . floatX ) ( 'xf' ) #NEWLINE# yf = Scalar ( theano . config . floatX ) ( 'yf' ) #NEWLINE# ei = true_div ( xi , yi ) #NEWLINE# fi = theano . function ( [ xi , yi ] , ei ) #NEWLINE# ef = true_div ( xf , yf ) #NEWLINE# ff = theano . function ( [ y_range , yf ] , ef ) #NEWLINE# for x_val in x_range : #NEWLINE# #INDENT# for y_val in y_range : #NEWLINE# #INDENT# outi = fi ( x_val , y_val ) #NEWLINE# outf = ff ( x_val , y_val ) #NEWLINE# assert ( outi . dtype == outf . dtype ) , 'incorrect dtype' #NEWLINE# assert np . allclose ( outi , outf ) , 'insufficient precision'