class_docstr: Manager class for stateful operators. This object holds a cache of reusable operators.
  Operators are initialized with deterministic seeds generated according to the ``seed`` argument
  and are reused when you call the same operator with the same scalar parameters.
  
  Example:
      >>> eager_state = dali.experimental.eager.rng_state(seed=42)
      >>> out1 = eager_state.random.normal(shape=[5, 5], batch_size=8)
      >>> # Here we will reuse the same operator.
      >>> out2 = eager_state.random.normal(shape=[5, 5], batch_size=8)
      >>> # And now we will create a new operator with new seed.
      >>> out3 = eager_state.random.normal(shape=[10, 10], batch_size=8)
class_docstr_tok: ["Manager","class","for","stateful","operators",".","This","object","holds","a","cache","of","reusable","operators",".","Operators","are","initialized","with","deterministic","seeds","generated","according","to","the","``","seed","``","argument","and","are","reused","when","you","call","the","same","operator","with","the","same","scalar","parameters",".","Example",":",">",">",">","eager_state","=","dali.experimental.eager.rng_state","(","seed=42",")",">",">",">","out1","=","eager_state.random.normal","(","shape=","[","5",",","5","]",",","batch_size=8",")",">",">",">","#","Here","we","will","reuse","the","same","operator",".",">",">",">","out2","=","eager_state.random.normal","(","shape=","[","5",",","5","]",",","batch_size=8",")",">",">",">","#","And","now","we","will","create","a","new","operator","with","new","seed",".",">",">",">","out3","=","eager_state.random.normal","(","shape=","[","10",",","10","]",",","batch_size=8",")"]
code: def __init__(self, seed=None):
      import numpy as np
  
      self._operator_cache = {}
      self._seed_generator = np.random.default_rng(seed)
  
      for name, submodule_class in rng_state._submodules.items():
          # Create attributes imitating submodules, e.g. `random`, `noise`.
          setattr(
              self,
              name,
              submodule_class(
                  self._operator_cache, self._seed_generator
              ),
          )
  
file_path: DALI/dali/python/nvidia/dali/experimental/eager/__init__.py
imports: from .None import math
  from nvidia.dali._utils.eager_utils import _create_module_class
label_desc: Use image node_id 1 to create a new rng_state object from inherited base classes:  with example: obj = rng_state(seed)