code: def add_layer_timing_signal_learned_1d(x, layer, num_layers):
    
    channels = common_layers.shape_list(x)[-1]
    signal = get_layer_timing_signal_learned_1d(channels, layer, num_layers)
    x += signal
    return x
docs: Add n-dimensional embedding as the layer (vertical) timing signal.
  
    Adds embeddings to represent the position of the layer in the tower.
  
    Args:
      x: a tensor with shape [batch, length, depth]
      layer: layer num
      num_layers: total number of layers
  
    Returns:
      a Tensor the same shape as x.