def contains_nan(arr, node=None, var=None):
 if isinstance(arr, theano.gof.type._cdata_type):
  return False
 elif isinstance(arr, np.random.mtrand.RandomState):
  return False
 elif (var and getattr(var.tag, 'is_rng', False)):
  return False
 elif isinstance(arr, slice):
  return False
 elif (arr.size == 0):
  return False
 elif (cuda.cuda_available and isinstance(arr, cuda.CudaNdarray)):
  if (node and hasattr(theano.sandbox, 'rng_mrg') and isinstance(node.op, theano.sandbox.rng_mrg.GPU_mrg_uniform)):
   return False
  else:
   compile_gpu_func(True, False, False)
   return np.isnan(f_gpumin(arr.reshape(arr.size)))
 elif (pygpu_available and isinstance(arr, GpuArray)):
  return np.isnan(f_gpua_min(arr.reshape(arr.size)))
 return np.isnan(np.min(arr))

def contains_nan ( arr , node = None , var = None ) : if isinstance ( arr , theano . gof . type . _cdata_type ) : return False elif isinstance ( arr , np . random . mtrand . RandomState ) : return False elif ( var and getattr ( var . tag , 'is_rng' , False ) ) : return False elif isinstance ( arr , slice ) : return False elif ( arr . size == 0 ) : return False elif ( cuda . cuda_available and isinstance ( arr , cuda . CudaNdarray ) ) : if ( node and hasattr ( theano . sandbox , 'rng_mrg' ) and isinstance ( node . op , theano . sandbox . rng_mrg . GPU_mrg_uniform ) ) : return False else : compile_gpu_func ( True , False , False ) return np . isnan ( f_gpumin ( arr . reshape ( arr . size ) ) ) elif ( pygpu_available and isinstance ( arr , GpuArray ) ) : return np . isnan ( f_gpua_min ( arr . reshape ( arr . size ) ) ) return np . isnan ( np . min ( arr ) )
test whether a numpy .