code: def broadcasting_elementwise(
      op: Callable[[tf.Tensor, tf.Tensor], tf.Tensor],
      a: tf.Tensor,
      b: tf.Tensor,
  ) -> tf.Tensor:
      """
      Apply binary operation `op` to every pair in tensors `a` and `b`.
  
      :param op: binary operator on tensors, e.g. tf.add, tf.substract
      """
      flatres = op(tf.reshape(a, [-1, 1]), tf.reshape(b, [1, -1]))
      return tf.reshape(
          flatres, tf.concat([tf.shape(a), tf.shape(b)], 0)
      )
  
file_path: GPflow/gpflow/utilities/ops.py
imports: import copy
  from typing import Any, Callable, List, Optional
  import tensorflow
  import tensorflow_probability
  from check_shapes import check_shapes
label_desc: Use image node_id 3 for calling a global function with example usage: broadcasting_elementwise(op, a, b) and returns: tf