def METHOD_NAME(value, w):
    w_ndim = np.ndim(w)
    if paillier_check.is_single_ipcl_encrypted_number(w):
        w_ndim += 1
    if isinstance(value, Instance):
        X = value.features
    else:
        X = value
    # # dot(a, b)[i, j, k, m] = sum(a[i, j, :] * b[k, :, m])
    # # One-dimension dot, which is the inner product of these two arrays
    if np.ndim(X) == w_ndim == 1:
        return _one_dimension_dot(X, w)
    elif np.ndim(X) == 2 and w_ndim == 1:
        res = []
        for x in X:
            res.append(_one_dimension_dot(x, w))
        res = np.array(res)
    else:
        res = np.METHOD_NAME(X, w)
    return res