class_docstr: Adds (optionally learned) positional embeddings to the inputs.
  
  Attributes:
    max_len: Maximum supported length
    posemb_init: Positional embedding initializer.
class_docstr_tok: ["Adds","(","optionally","learned",")","positional","embeddings","to","the","inputs",".","Attributes",":","max_len",":","Maximum","supported","length","posemb_init",":","Positional","embedding","initializer","."]
docstr: Applies AddPositionEmbs module.
  
  By default this layer uses a fixed sinusoidal embedding table. If a
  learned position embedding is desired, pass an initializer to
  posemb_init in the configuration.
  Args:
    inputs: input data.
  Returns:
    output: `[bs, timesteps, in_dim]`
docstr_tok: ["Applies","AddPositionEmbs","module",".","By","default","this","layer","uses","a","fixed","sinusoidal","embedding","table",".","If","a","learned","position","embedding","is","desired",",","pass","an","initializer","to","posemb_init","in","the","configuration",".","Args",":","inputs",":","input","data",".","Returns",":","output",":","`","[","bs",",","timesteps",",","in_dim","]","`"]
code: def __call__(self, inputs):
      """Applies AddPositionEmbs module.
  
      By default this layer uses a fixed sinusoidal embedding table. If a
      learned position embedding is desired, pass an initializer to
      posemb_init in the configuration.
      Args:
        inputs: input data.
      Returns:
        output: `[bs, timesteps, in_dim]`
      """
      # Inputs.shape is [batch_size, seq_len, emb_dim].
      assert inputs.ndim == 3, (
          "Number of dimensions should be 3,"
          " but it is: %d" % inputs.ndim
      )
      length = inputs.shape[1]
      pos_emb_shape = (1, self.max_len, inputs.shape[-1])
      if self.posemb_init is None:
          # Use a fixed (non-learned) sinusoidal position embedding.
          pos_embedding = sinusoidal_init(max_len=self.max_len)(
              None, pos_emb_shape, None
          )
      else:
          pos_embedding = self.param(
              "pos_embedding", self.posemb_init, pos_emb_shape
          )
      pe = pos_embedding[:, :length, :]
      return inputs + pe
  
imports: from typing import Any, Callable, Optional, Sequence, Tuple, Union
  import flax.linen
  import jax
  from jax.nn import initializers
  import jax.numpy
  import numpy
  from scenic.model_lib.layers import nn_layers
label_desc: Use image node_id 1 for calling the AddPositionEmbs obj's underlying member method code with example usage: obj.__call__(inputs) and returns: unknown