class_docstr: Implements fixed-base positional encoding.
class_docstr_tok: ["Implements","fixed-base","positional","encoding","."]
code: def init_weights_and_state(self, input_signature):
      d_feature = input_signature.shape[-1]
      if d_feature % self._n_digits != 0:
          raise ValueError(
              f"d_feature({d_feature}) % self._n_digits({self._n_digits}) != 0"
          )
      d_weight = d_feature // self._n_digits
      rng1, rng2 = fastmath.random.split(self.rng, 2)
      base_weights = [
          [
              self._initializer((1, d_weight), rng)
              for rng in fastmath.random.split(rng1, self._n_digits)
          ]
          for _ in self._bases
      ]
      # Special vector to mark the starting position.
      start_vec = self._initializer((1, 1, d_feature), rng2)
      self.weights = (base_weights, start_vec)
      if self._mode == "predict":
          self.state = jnp.zeros((), dtype=jnp.int32)
  
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 3 for calling the FixedBasePositionalEncoding obj's underlying member method code with example usage: obj.init_weights_and_state(input_signature) without return types