class_docstr: Module component with similar interface to numpy.random
  (numpy.random.RandomState)
  
  Parameters
  ----------
  seed: None or int
      A default seed to initialize the RandomState
      instances after build.  See `RandomStreamsInstance.__init__`
      for more details.
docstr: Create a new random stream in this container.
  
  Parameters
  ----------
  op
      A RandomFunction instance to
  args
      Interpreted by `op`.
  kwargs
      Interpreted by `op`.
  
  Returns
  -------
  Tensor Variable
      The symbolic random draw part of op()'s return value.
      This function stores the updated RandomStateType Variable
      for use at `build` time.
docstr_tok: ["Create","a","new","random","stream","in","this","container",".","Parameters","--","--","--","--","--","op","A","RandomFunction","instance","to","args","Interpreted","by","`","op","`",".","kwargs","Interpreted","by","`","op","`",".","Returns","--","--","--","-","Tensor","Variable","The","symbolic","random","draw","part","of","op","(",")","'s","return","value",".","This","function","stores","the","updated","RandomStateType","Variable","for","use","at","`","build","`","time","."]
code: def gen(self, op, *args, **kwargs):
      """
      Create a new random stream in this container.
  
      Parameters
      ----------
      op
          A RandomFunction instance to
      args
          Interpreted by `op`.
      kwargs
          Interpreted by `op`.
  
      Returns
      -------
      Tensor Variable
          The symbolic random draw part of op()'s return value.
          This function stores the updated RandomStateType Variable
          for use at `build` time.
  
      """
      seed = int(self.gen_seedgen.randint(2**30))
      random_state_variable = shared(np.random.RandomState(seed))
      # Add a reference to distinguish from other shared variables
      random_state_variable.tag.is_rng = True
      new_r, out = op(random_state_variable, *args, **kwargs)
      out.rng = random_state_variable
      out.update = (random_state_variable, new_r)
      self.state_updates.append(out.update)
      random_state_variable.default_update = new_r
      return out
  
file_path: Theano/theano/tensor/shared_randomstreams.py
imports: from __future__ import absolute_import, print_function, division
  import copy
  import numpy
  from theano.compile.sharedvalue import SharedVariable, shared_constructor, shared
  from theano.tensor import raw_random
label_desc: Use image node_id 6 for calling the RandomStreams obj's underlying member method code with example usage: obj.gen(op) and returns: out