code: def outer_multiply(x, y):
      """Performs an outer multiplication of two tensors.
  
      Given two `Tensor`s, `S` and `T` of shape `s` and `t` respectively, the outer
      product `P` is a `Tensor` of shape `s + t` whose components are given by:
  
      ```none
      P_{i1,...ik, j1, ... , jm} = S_{i1...ik} T_{j1, ... jm}
      ```
  
      Args:
        x: A `Tensor` of any shape and numeric dtype.
        y: A `Tensor` of any shape and the same dtype as `x`.
  
      Returns:
        outer_product: A `Tensor` of shape Shape[x] + Shape[y] and the same dtype
          as `x`.
      """
      x_shape = tf.shape(x)
      padded_shape = tf.concat(
          [x_shape, tf.ones(tf.rank(y), dtype=x_shape.dtype)], axis=0
      )
      return tf.reshape(x, padded_shape) * y
  
file_path: tf-quant-finance/tf_quant_finance/models/legacy/brownian_motion_utils.py
imports: import tensorflow.compat.v2
  from tf_quant_finance.math import gradient
label_desc: Use image node_id 2 for calling a global function with example usage: outer_multiply(x, y) and returns: unknown