def METHOD_NAME(x):
    """NumPy implementation of softmax.
    The computation is performed with 64-bit floats. There is also an
    implementation of softmax in SciPy 1.2.0 (scipy.special.softmax).
    """
    if x.dtype is not np.float64:
        x = x.astype(np.float64)
    y = np.exp(x - np.max(x))
    return y / np.sum(y)