def METHOD_NAME(weights_finite, prime_number):
    """
    weights_finite : array of state_dict()
    prime_number   : size of the finite field
    """
    w_sum = copy.deepcopy(weights_finite[0])
    for key in w_sum.keys():
        for i in range(1, len(weights_finite)):
            w_sum[key] += weights_finite[i][key]
            w_sum[key] = np.mod(w_sum[key], prime_number)
    return w_sum