code: def layer_preprocess(layer_input, hparams, layer_collection=None):
    
    assert "a" not in hparams.layer_preprocess_sequence, (
        "No residual connections allowed in hparams.layer_preprocess_sequence")
    assert "z" not in hparams.layer_preprocess_sequence, (
        "No residual connections allowed in hparams.layer_preprocess_sequence")
    return layer_prepostprocess(
        None,
        layer_input,
        sequence=hparams.layer_preprocess_sequence,
        dropout_rate=hparams.layer_prepostprocess_dropout,
        norm_type=hparams.norm_type,
        depth=None,
        epsilon=hparams.norm_epsilon,
        dropout_broadcast_dims=comma_separated_string_to_integer_list(
            getattr(hparams, "layer_prepostprocess_dropout_broadcast_dims", "")),
        default_name="layer_prepostprocess",
        layer_collection=layer_collection)
docs: Apply layer preprocessing.
  
    See layer_prepostprocess() for details.
  
    A hyperparameters object is passed for convenience.  The hyperparameters
    that may be used are:
  
      layer_preprocess_sequence
      layer_prepostprocess_dropout
      norm_type
      hidden_size
      norm_epsilon
  
    Args:
      layer_input: a Tensor
      hparams: a hyperparameters object.
      layer_collection: A tensorflow_kfac.LayerCollection. Only used by the
        KFAC optimizer. Default is None.
  
    Returns:
      a Tensor