code: def __init__(
      self,
      seed_getter,
      offset,
      state_type,
      vector_type,
      generator_bits,
      additional_source,
      scramble_type=None,
  ):
      super().__init__(
          state_type, vector_type, generator_bits, additional_source
      )
  
      generator_count = self.generators_per_block * self.block_count
      if seed_getter is None:
          seed = array.to_gpu(
              np.asarray(
                  np.random.randint(0, (1 << 31) - 1, generator_count),
                  dtype=np.int32,
              )
          )
      else:
          seed = seed_getter(generator_count)
  
      if not (
          isinstance(seed, pycuda.gpuarray.GPUArray)
          and seed.dtype == np.int32
          and seed.size == generator_count
      ):
          raise TypeError(
              "seed must be GPUArray of integers of right length"
          )
  
      p = self.module.get_function("prepare")
      p.prepare("PnPn")
  
      from pycuda.characterize import has_stack
  
      has_stack = has_stack()
  
      if has_stack:
          prev_stack_size = drv.Context.get_limit(drv.limit.STACK_SIZE)
  
      try:
          if has_stack:
              drv.Context.set_limit(
                  drv.limit.STACK_SIZE, 1 << 14
              )  # 16k
          try:
              p.prepared_call(
                  (self.block_count, 1),
                  (self.generators_per_block, 1, 1),
                  self.state,
                  generator_count,
                  seed.gpudata,
                  offset,
              )
          except drv.LaunchError:
              raise ValueError(
                  "Initialisation failed. Decrease number of threads."
              )
  
      finally:
          if has_stack:
              drv.Context.set_limit(
                  drv.limit.STACK_SIZE, prev_stack_size
              )
  
imports: import numpy
  import pycuda.compiler
  import pycuda.driver
  import pycuda.gpuarray
  from pytools import memoize_method
label_desc: Use image node_id 1 to create a new _PseudoRandomNumberGeneratorBase object from inherited base classes: _RandomNumberGeneratorBase with example: obj = _PseudoRandomNumberGeneratorBase(seed_getter, offset, state_type, vector_type, generator_bits, additional_source, scramble_type)