blazefl.reproducibility.RNGSuite#

class blazefl.reproducibility.RNGSuite(python: Random, numpy: Generator, torch_cpu: Generator, torch_cuda: Generator | None = None)[source]#

Bases: object

A container for a suite of isolated random number generators.

This class holds independent, seeded generator objects for each library. Using an RNGSuite instance allows for randomness control that is self-contained and does not interfere with the global state, making it suitable for components or libraries that need their own random stream.

python#

An isolated random.Random generator.

Type:

random.Random

numpy#

An isolated numpy.random.Generator instance.

Type:

numpy.random._generator.Generator

torch_cpu#

A torch.Generator for CPU operations.

Type:

torch._C.Generator

torch_cuda#

A torch.Generator for CUDA operations, if available.

Type:

torch._C.Generator | None

__init__(python: Random, numpy: Generator, torch_cpu: Generator, torch_cuda: Generator | None = None) None#

Methods

__init__(python, numpy, torch_cpu[, torch_cuda])

Attributes

numpy: Generator#
python: Random#
torch_cpu: Generator#
torch_cuda: Generator | None = None#