#NEWLINE# @ gof . local_optimizer ( [ sigmoid ] ) #NEWLINE# def local_hard_sigmoid( node ) : #NEWLINE# #INDENT# if ( isinstance ( node . op , tensor . Elemwise ) and ( node . op . scalar_op == scalar_sigmoid ) ) : #NEWLINE# #INDENT# out = hard_sigmoid ( node . inputs [ 0 ] ) #NEWLINE# def values_eq_approx_remove_low_prec( a , b ) : #NEWLINE# #INDENT# return tensor . TensorType . values_eq_approx ( a , b , atol = 0.1 ) #NEWLINE# #UNINDENT# out . tag . values_eq_approx = values_eq_approx_remove_low_prec #NEWLINE# return [ out ]