def _is_zero(x):
    if not hasattr(x, 'type'):
        return np.all(x == 0.)
    if isinstance(x.type, NullType):
        return 'no'
    if isinstance(x.type, DisconnectedType):
        return 'yes'

    no_constant_value = True
    try:
        constant_value = theano.get_scalar_constant_value(x)
        no_constant_value = False
    except theano.tensor.basic.NotScalarConstantError:
        pass

    if no_constant_value:
        return 'maybe'

    if constant_value != 0.:
        return 'no'

    return 'yes'
Returns 'yes', 'no', or 'maybe' indicating whether x
dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/gradient.py/_is_zero