class_docstr: Op that draws random numbers from a numpy.random.RandomState object.
  
  Parameters
  ----------
  fn : string or function reference
      A member function of numpy.random.RandomState. A string will
      be interpreted as the name of a member function of
      numpy.random.RandomState.
      Technically, any function with a signature like the ones in
      numpy.random.RandomState will do. This function must accept
      the shape (sometimes called size) of the output as the last
      positional argument.
  outtype
      The theano Type of the output.
  args
      A list of default arguments for the function
      kwargs
      If the 'inplace' key is there, its value will be used to
      determine if the op operates inplace or not.
      If the 'ndim_added' key is there, its value indicates how
      many more dimensions this op will add to the output, in
      addition to the shape's dimensions (used in multinomial and
      permutation).
class_docstr_tok: ["Op","that","draws","random","numbers","from","a","numpy.random.RandomState","object",".","Parameters","--","--","--","--","--","fn",":","string","or","function","reference","A","member","function","of","numpy.random.RandomState",".","A","string","will","be","interpreted","as","the","name","of","a","member","function","of","numpy.random.RandomState",".","Technically",",","any","function","with","a","signature","like","the","ones","in","numpy.random.RandomState","will","do",".","This","function","must","accept","the","shape","(","sometimes","called","size",")","of","the","output","as","the","last","positional","argument",".","outtype","The","theano","Type","of","the","output",".","args","A","list","of","default","arguments","for","the","function","kwargs","If","the","'inplace","'","key","is","there",",","its","value","will","be","used","to","determine","if","the","op","operates","inplace","or","not",".","If","the","'ndim_added","'","key","is","there",",","its","value","indicates","how","many","more","dimensions","this","op","will","add","to","the","output",",","in","addition","to","the","shape","'s","dimensions","(","used","in","multinomial","and","permutation",")","."]
docstr: Parameters
  ----------
  r
      A numpy.random.RandomState instance, or a Variable of Type
      RandomStateType that will contain a RandomState instance.
  shape
      An lvector with a shape defining how many samples
      to draw.  In the case of scalar distributions, it is the shape
      of the tensor output by this Op.  In that case, at runtime, the
      value associated with this lvector must have a length equal to
      the number of dimensions promised by `self.outtype`.
      In a more general case, the number of output dimensions,
      len(self.outtype), is equal to len(shape)+self.ndim_added.
      The special case where len(shape) == 0 means that the smallest
      shape compatible with the argument's shape will be used.
  args
      The values associated with these variables will be passed to the
      RandomState function during perform as extra "*args"-style
      arguments. These should be castable to variables of Type TensorType.
  
  Returns
  -------
  Apply
      Apply with two outputs. The first output is a gof.generic Variable
      from which to draw further random numbers.
      The second output is the outtype() instance holding the random
      draw.
docstr_tok: ["Parameters","--","--","--","--","--","r","A","numpy.random.RandomState","instance",",","or","a","Variable","of","Type","RandomStateType","that","will","contain","a","RandomState","instance",".","shape","An","lvector","with","a","shape","defining","how","many","samples","to","draw",".","In","the","case","of","scalar","distributions",",","it","is","the","shape","of","the","tensor","output","by","this","Op",".","In","that","case",",","at","runtime",",","the","value","associated","with","this","lvector","must","have","a","length","equal","to","the","number","of","dimensions","promised","by","`","self.outtype","`",".","In","a","more","general","case",",","the","number","of","output","dimensions",",","len","(","self.outtype",")",",","is","equal","to","len","(","shape",")","+self.ndim_added",".","The","special","case","where","len","(","shape",")","==","0","means","that","the","smallest","shape","compatible","with","the","argument","'s","shape","will","be","used",".","args","The","values","associated","with","these","variables","will","be","passed","to","the","RandomState","function","during","perform","as","extra","``","*","args","''","-style","arguments",".","These","should","be","castable","to","variables","of","Type","TensorType",".","Returns","--","--","--","-","Apply","Apply","with","two","outputs",".","The","first","output","is","a","gof.generic","Variable","from","which","to","draw","further","random","numbers",".","The","second","output","is","the","outtype","(",")","instance","holding","the","random","draw","."]
code: def make_node(self, r, shape, *args):
      """
      Parameters
      ----------
      r
          A numpy.random.RandomState instance, or a Variable of Type
          RandomStateType that will contain a RandomState instance.
      shape
          An lvector with a shape defining how many samples
          to draw.  In the case of scalar distributions, it is the shape
          of the tensor output by this Op.  In that case, at runtime, the
          value associated with this lvector must have a length equal to
          the number of dimensions promised by `self.outtype`.
          In a more general case, the number of output dimensions,
          len(self.outtype), is equal to len(shape)+self.ndim_added.
          The special case where len(shape) == 0 means that the smallest
          shape compatible with the argument's shape will be used.
      args
          The values associated with these variables will be passed to the
          RandomState function during perform as extra "*args"-style
          arguments. These should be castable to variables of Type TensorType.
  
      Returns
      -------
      Apply
          Apply with two outputs. The first output is a gof.generic Variable
          from which to draw further random numbers.
          The second output is the outtype() instance holding the random
          draw.
  
      """
      shape_ = tensor.as_tensor_variable(shape, ndim=1)
      if shape == ():
          shape = shape_.astype("int64")
      else:
          shape = shape_
      assert shape.type.ndim == 1
      assert (shape.type.dtype == "int64") or (
          shape.type.dtype == "int32"
      )
      if not isinstance(r.type, RandomStateType):
          print(
              "WARNING: RandomState instances should be in RandomStateType",
              file=sys.stderr,
          )
      # the following doesn't work because we want to ignore the
      # broadcastable flags in shape.type
      # assert shape.type == tensor.lvector
  
      # convert args to TensorType instances
      # and append enough None's to match the length of self.args
      args = list(map(tensor.as_tensor_variable, args))
  
      return gof.Apply(
          self, [r, shape] + args, [r.type(), self.outtype()]
      )
  
imports: from __future__ import absolute_import, print_function, division
  import sys
  from copy import copy
  import numpy
  from six import string_types
  from six.moves import reduce, xrange
  import theano
  from theano import tensor
  from theano.tensor import opt
  from theano import gof
  from theano.compile import optdb
label_desc: Use image node_id 5 for calling the RandomFunction obj's underlying member method code with example usage: obj.make_node(r, shape) and returns: gof