예제 #1
0
파일: promotion.py 프로젝트: garaud/blaze
def promote_scalars(a, b):
    """Promote two CTypes"""
    return CType.from_numpy_dtype(np.result_type(to_numpy(a), to_numpy(b)))
예제 #2
0
def promote_scalars(a, b):
    """Promote two CTypes"""
    try:
        return CType.from_numpy_dtype(np.result_type(to_numpy(a), to_numpy(b)))
    except TypeError, e:
        raise TypeError("Cannot promote %s and %s: %s" % (a, b, e))