def spatial_projection(self, cond_inputs):
    if self.spatial_average == 'learnable':
      cond_inputs = self.spatial_weights * cond_inputs
    return tf.reduce_mean(cond_inputs, axis=(1, 2), keepdims=True)