import tensorflow as tf

    return average_grads

def binary_mask(shape, p=0.7):
    samples = tf.random_uniform(shape, minval=0.0, maxval=1.0)
    mask = tf.less_equal(samples, p)
    return tf.cast(mask, tf.float32)

def weighted_arithmetic_mean(w, x):
