class_docstr: Adds 1-dimensional positional embeddings to the inputs.
  
  Attributes:
    rescale_from: tuple; If not None, embeddings are rescaled from this shape.
    max_len: int; Maximum possible length for the input. If None, the max_len is
      set to the inputs sequence length.
    posemb_init: Positional embedding initializer.
    param_name: The name of the parameter that stores the positional embedding.
class_docstr_tok: ["Adds","1-dimensional","positional","embeddings","to","the","inputs",".","Attributes",":","rescale_from",":","tuple",";","If","not","None",",","embeddings","are","rescaled","from","this","shape",".","max_len",":","int",";","Maximum","possible","length","for","the","input",".","If","None",",","the","max_len","is","set","to","the","inputs","sequence","length",".","posemb_init",":","Positional","embedding","initializer",".","param_name",":","The","name","of","the","parameter","that","stores","the","positional","embedding","."]
docstr: Applies Add1DPositionEmbedding module.
  
  Args:
    inputs: nd-arrary; Input data.
  
  Returns:
    Output: `(bs, timesteps, in_dim)`.
docstr_tok: ["Applies","Add1DPositionEmbedding","module",".","Args",":","inputs",":","nd-arrary",";","Input","data",".","Returns",":","Output",":","`","(","bs",",","timesteps",",","in_dim",")","`","."]
code: def __call__(self, inputs: jnp.ndarray) -> jnp.ndarray:
      """Applies Add1DPositionEmbedding module.
  
      Args:
        inputs: nd-arrary; Input data.
  
      Returns:
        Output: `(bs, timesteps, in_dim)`.
      """
      assert inputs.ndim == 3, (
          "Number of dimensions should be 3,"
          " but it is: %d" % inputs.ndim
      )
      length = inputs.shape[1]
      max_len = self.max_len or length
      embedding_length = max_len
  
      if self.rescale_from:  # Shape: `[len, c]`.
          embedding_length = self.rescale_from[0]
  
      pos_emb_shape = (1, embedding_length, inputs.shape[-1])
      if self.posemb_init is None:
          # Use a fixed (non-learned) sinusoidal position embedding.
          pos_embedding = sinusoidal_init(max_len=embedding_length)(
              None,  # pytype: disable=wrong-arg-types  # jax-ndarray
              pos_emb_shape,
              None,
          )
      else:
          pos_embedding = self.param(
              self.param_name, self.posemb_init, pos_emb_shape
          )
      pe = pos_embedding[:, :length, :]
  
      if max_len != embedding_length:
          pe = jax.image.resize(
              pe,
              (1, max_len, pe.shape[-1]),
              method="bilinear",
              antialias=False,
          )
          pe = jnp.reshape(pe, (1, max_len, -1))
      return inputs + pe
  
imports: import functools
  from typing import Callable, Optional, Sequence, Tuple
  import flax.linen
  import jax
  import jax.numpy
  import numpy
  from scenic.model_lib.layers import nn_layers
label_desc: Use image node_id 1 for calling the Add1DPositionEmbedding obj's underlying member method code with example usage: obj.__call__(inputs) and returns: unknown