<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def concat(input_layer, concat_dim, other_tensors=None):
 """Concatenates input PrettyTensor with other_tensors along the specified dim. This adds the Pretty Tensor passed via input_layer to the front of the list of tensors to concat. Args: input_layer: The input layer. concat_dim: The dimension along which to concat. other_tensors: The tensors to concatenate with as an iterable or None if this is called on a sequence. Returns: A new PrettyTensor. Raises: ValueError: If other_tensors is None and this is not a sequence. """

  if input_layer.is_sequence():
    all_tensors = input_layer.sequence
    all_tensors.extend(other_tensors or [])
  else:
    all_tensors = [input_layer]
    if other_tensors is None:
      raise ValueError('Other Tensors must be supplied.')
    all_tensors.extend(other_tensors)
  # Edge cases really only apply when this is a sequence with 0 or 1 element.
  if not all_tensors:
    return prettytensor.wrap_sequence([])
  else:
    return tf.concat(all_tensors, concat_dim)