code: def PositionalEncoding(x, params, **unused_kwargs):
    
    if not isinstance(x, (list, tuple)):  # non-chunked inputs
      symbol_size = np.shape(x)[1]
      return x + params[:, :symbol_size, :]
    # Chunked case: apply to all chunks selecting as much as needed.
    offset = 0
    results = []
    for chunk in x:
      symbol_size = np.shape(chunk)[1]
      results.append(chunk + params[:, offset:offset + symbol_size, :])
      offset += symbol_size
    return results
docs: Implements bare positional encoding.