tf.keras.layers.Average

Layer that averages a list of inputs element-wise.

It takes as input a list of tensors, all of the same shape, and returns a single tensor (also of the same shape).

Example:

x1 = np.ones((2, 2))
x2 = np.zeros((2, 2))
y = tf.keras.layers.Average()([x1, x2])
y.numpy().tolist()
[[0.5, 0.5], [0.5, 0.5]]

Usage in a functional model: