def rng(self):
    """Returns this layer's current single-use random number generator.

    Code that wants to base random samples on this generator must explicitly
    split off new generators from it. (See, for example, the `rng` setter code
    below.)
    """
    if self._rng is None:
      # One-time initialization from backend-neutral seed int.
      self._rng = fastmath.random.get_prng(self._rng_seed_int)
    return self._rng
Returns this layer's current single-use random number generator.

    Code that wants to base random samples on this generator must explicitly
    split off new generators from it. (See, for example, the `rng` setter code
    below.)
    
trax/layers/base.py