sequince_density.utils#
Utility helpers shared by density implementations.
Functions#
|
Consume one deterministic integer seed from an optional RNG. |
|
Temporarily seed Torch and restore its global RNG state on exit. |
Module Contents#
- sequince_density.utils.draw_seed(rng)#
Consume one deterministic integer seed from an optional RNG.
- sequince_density.utils.torch_random_context(rng=None, *, device=None)#
Temporarily seed Torch and restore its global RNG state on exit.
- Parameters:
rng (orng.RandomGenerator | int | None)
device (Any)
- Return type:
collections.abc.Generator[None, None, None]