def upgrade_to_float_no_complex(*types):
    for type in types:
        if type in complex_types:
            raise TypeError('complex argument not supported')
    return upgrade_to_float(*types)
Don't accept complex, otherwise call upgrade_to_float().
dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/scalar/basic.py/upgrade_to_float_no_complex