class_docstr: Just the engineered features from InfinitePositionalEncoding.
class_docstr_tok: ["Just","the","engineered","features","from","InfinitePositionalEncoding","."]
docstr: Get embeddings float[..., num_features].
  
  Args:
    t: int[...] position (i.e. jnp.arange(..., jnp.int32))
  
  Returns:
    embeddings: float[..., num_features]
docstr_tok: ["Get","embeddings","float","[","...",",","num_features","]",".","Args",":","t",":","int","[","...","]","position","(","i.e",".","jnp.arange","(","...",",","jnp.int32",")",")","Returns",":","embeddings",":","float","[","...",",","num_features","]"]
code: def _get_embeddings(self, t):
      """Get embeddings float[..., num_features].
  
      Args:
        t: int[...] position (i.e. jnp.arange(..., jnp.int32))
  
      Returns:
        embeddings: float[..., num_features]
      """
      inter_bin_idx, intra_bin_idx = divmod(t, self._time_bin_length)
      bin_parity = inter_bin_idx % 2
      bin_fraction = intra_bin_idx / self._time_bin_length
      embeddings = jnp.stack(
          [
              1 / (1 + inter_bin_idx),
              bin_fraction,
              bin_parity.astype(jnp.float32),
          ],
          -1,
      )
  
      assert embeddings.shape == t.shape + (
          self.num_features,
      ), embeddings.shape
      return embeddings
  
imports: import logging
  import jax
  import jax.extend
  import numpy
  import trax
  from trax import fastmath
  from trax.fastmath import numpy
  from trax.layers import base
  from trax.layers import initializers
label_desc: Use image node_id 2 for calling the TimeBinPositionalEncoding obj's underlying member method code with example usage: obj._get_embeddings(t) and returns: embeddings