code: def _prepare_boundary_conditions(boundary_tensor, value_grid):
      """Prepares values received from boundary_condition callables."""
      if boundary_tensor is None:
          return None
      boundary_tensor = tf.convert_to_tensor(
          boundary_tensor, value_grid.dtype
      )
      # Broadcast to batch dimensions.
      broadcast_shape = utils.get_shape(value_grid)[:-1]
      return tf.broadcast_to(boundary_tensor, broadcast_shape)
  
file_path: tf-quant-finance/tf_quant_finance/math/pde/steppers/parabolic_equation_stepper.py
imports: import tensorflow.compat.v2
  from tf_quant_finance import utils
label_desc: Use image node_id 9 for calling a global function with example usage: _prepare_boundary_conditions(boundary_tensor, value_grid) and returns: tf, None