original_docstring: Returns a list of layers implementing a feed-forward block.
  
    Args:
      d_model: int:  depth of embedding
      d_ff: int: depth of feed-forward layer
      dropout: float: dropout rate (how much to drop out)
      layer_idx: which layer are we at (for bookkeeping)
      mode: str: 'train' or 'eval'
      activation: the non-linearity in feed-forward layer
  
    Returns:
      A list of layers which maps vectors to vectors.
    
docstring: Returns a list of layers implementing a feed-forward block.
docstring_tokens: Returns a list of layers implementing a feed - forward block .
code: def _FeedForwardBlock(d_model, d_ff, dropout, layer_idx, mode, activation):
    """Returns a list of layers implementing a feed-forward block.
  
    Args:
      d_model: int:  depth of embedding
      d_ff: int: depth of feed-forward layer
      dropout: float: dropout rate (how much to drop out)
      layer_idx: which layer are we at (for bookkeeping)
      mode: str: 'train' or 'eval'
      activation: the non-linearity in feed-forward layer
  
    Returns:
      A list of layers which maps vectors to vectors.
    """
    dropout_middle = tl.Dropout(
        rate=dropout, name='ff_middle_%d' % layer_idx, mode=mode)
    dropout_final = tl.Dropout(
        rate=dropout, name='ff_final_%d' % layer_idx, mode=mode)
  
    return [
        tl.LayerNorm(),
        tl.Dense(d_ff),
        activation(),
        dropout_middle,
        tl.Dense(d_model),
        dropout_final,
    ]
code_tokens: def _FeedForwardBlock ( d_model , d_ff , dropout , layer_idx , mode , activation ) : dropout_middle = tl . Dropout ( rate = dropout , name = 'ff_middle_%d' % layer_idx , mode = mode ) dropout_final = tl . Dropout ( rate = dropout , name = 'ff_final_%d' % layer_idx , mode = mode ) return [ tl . LayerNorm ( ) , tl . Dense ( d_ff ) , activation ( ) , dropout_middle , tl . Dense ( d_model ) , dropout_final , ]
short_docstring: Returns a list of layers implementing a feed-forward block.
short_docstring_tokens: Returns a list of layers implementing a feed - forward block .
comment: """Returns a list of layers implementing a feed-forward block.
  
    Args:
      d_model: int:  depth of embedding
      d_ff: int: depth of feed-forward layer
      dropout: float: dropout rate (how much to drop out)
      layer_idx: which layer are we at (for bookkeeping)
      mode: str: 'train' or 'eval'
      activation: the non-linearity in feed-forward layer
  
    Returns:
      A list of layers which maps vectors to vectors.
    """