<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def join_pretty_tensors(tensors, output, join_function=None, name='join'):
 """Joins the list of pretty_tensors and sets head of output_pretty_tensor. Args: tensors: A sequence of Layers or SequentialLayerBuilders to join. output: A pretty_tensor to set the head with the result. join_function: A function to join the tensors, defaults to concat on the last dimension. name: A name that is used for the name_scope Returns: The result of calling with_tensor on output Raises: ValueError: if pretty_tensors is None or empty. """

  if not tensors:
    raise ValueError('pretty_tensors must be a non-empty sequence.')
  with output.g.name_scope(name):
    if join_function is None:
      # Use depth concat
      last_dim = len(tensors[0].shape) - 1
      return output.with_tensor(tf.concat(tensors, last_dim))
    else:
      return output.with_tensor(join_function(tensors))