#NEWLINE# @ staticmethod #NEWLINE# def _test_unary( unary_op , x_range ) : #NEWLINE# #INDENT# xi = int8 ( 'xi' ) #NEWLINE# xf = float32 ( 'xf' ) #NEWLINE# ei = unary_op ( xi ) #NEWLINE# fi = theano . function ( [ xi ] , ei ) #NEWLINE# ef = unary_op ( xf ) #NEWLINE# ff = theano . function ( [ xf ] , ef ) #NEWLINE# for x_val in x_range : #NEWLINE# #INDENT# outi = fi ( x_val ) #NEWLINE# outf = ff ( x_val ) #NEWLINE# assert ( outi . dtype == outf . dtype ) , 'incorrect dtype' #NEWLINE# assert np . allclose ( outi , ff ) , 'insufficient precision'