def compile_gpu_func(nan_is_error, inf_is_error, big_is_error):
 global f_gpumin, f_gpumax, f_gpuabsmax
 if (not cuda.cuda_available):
  return
 guard_input = cuda.fvector('nan_guard')
 cuda_compile_failed = False
 if ((nan_is_error or inf_is_error) and (f_gpumin is None)):
  try:
   f_gpumin = theano.function([guard_input], T.min(guard_input), mode='FAST_RUN')
  except RuntimeError:
   cuda_compile_failed = True
 if (inf_is_error and (not cuda_compile_failed) and (f_gpumax is None)):
  try:
   f_gpumax = theano.function([guard_input], T.max(guard_input), mode='FAST_RUN')
  except RuntimeError:
   cuda_compile_failed = True
 if (big_is_error and (not cuda_compile_failed) and (f_gpuabsmax is None)):
  try:
   f_gpuabsmax = theano.function([guard_input], T.max(T.abs_(guard_input)), mode='FAST_RUN')
  except RuntimeError:
   cuda_compile_failed = True

def compile_gpu_func ( nan_is_error , inf_is_error , big_is_error ) : global f_gpumin , f_gpumax , f_gpuabsmax if ( not cuda . cuda_available ) : return guard_input = cuda . fvector ( 'nan_guard' ) cuda_compile_failed = False if ( ( nan_is_error or inf_is_error ) and ( f_gpumin is None ) ) : try : f_gpumin = theano . function ( [ guard_input ] , T . min ( guard_input ) , mode = 'FAST_RUN' ) except RuntimeError : cuda_compile_failed = True if ( inf_is_error and ( not cuda_compile_failed ) and ( f_gpumax is None ) ) : try : f_gpumax = theano . function ( [ guard_input ] , T . max ( guard_input ) , mode = 'FAST_RUN' ) except RuntimeError : cuda_compile_failed = True if ( big_is_error and ( not cuda_compile_failed ) and ( f_gpuabsmax is None ) ) : try : f_gpuabsmax = theano . function ( [ guard_input ] , T . max ( T . abs_ ( guard_input ) ) , mode = 'FAST_RUN' ) except RuntimeError : cuda_compile_failed = True
compile utility function used by contains_nan and contains_inf .