theano/compile/nanguardmode.py
def _is_numeric_value(arr, var):
    """
    Checks a variable against non-numeric types such as types, slices,
    empty arrays, and None, that need not be checked for NaN and Inf values.

    Parameters
    ----------
    arr : the data of that correspond to any Theano Variable
    var : The corresponding Theano variable

    Returns
    -------
    is_non_numeric : bool
        `True` the value is non-numeric.

    """
    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 is None:
        return False
    elif arr.size == 0:
        return False
    return True

    Checks a variable against non-numeric types such as types, slices,
    empty arrays, and None, that need not be checked for NaN and Inf values.

    Parameters
    ----------
    arr : the data of that correspond to any Theano Variable
    var : The corresponding Theano variable

    Returns
    -------
    is_non_numeric : bool
        `True` the value is non-numeric.

    
Checks a variable against non-numeric types such as types, slices,
empty arrays, and None, that need not be checked for NaN and Inf values.

Parameters

arr : the data of that correspond to any Theano Variable
var : The corresponding Theano variable

Returns

is_non_numeric : bool
`True` the value is non-numeric.
Checks a variable against non - numeric types such as types slices empty arrays and None that need not be checked for NaN and Inf values . Parameters arr : the data of that correspond to any Theano Variable var : The corresponding Theano variable Returns is_non_numeric : bool ` True ` the value is non - numeric .
def _is_numeric_value(arr, var):
    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 is None:
        return False
    elif arr.size == 0:
        return False
    return True
def _is_numeric_value ( arr , var ) : 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 is None : return False elif arr . size == 0 : return False return True
Checks a variable against non-numeric types such as types, slices,
empty arrays, and None, that need not be checked for NaN and Inf values.
Checks a variable against non - numeric types such as types slices empty arrays and None that need not be checked for NaN and Inf values .
"""
    Checks a variable against non-numeric types such as types, slices,
    empty arrays, and None, that need not be checked for NaN and Inf values.

    Parameters
    ----------
    arr : the data of that correspond to any Theano Variable
    var : The corresponding Theano variable

    Returns
    -------
    is_non_numeric : bool
        `True` the value is non-numeric.

    """
arr
var