code: def gen_lazy_function(self):
          
  
          # If value argument to __init__ was None, draw value from random
          # method.
          if self._value is None:
  
              # Use random function if provided
              if self._random is not None:
                  self.value = self._random(**self._parents.value)
  
              # Otherwise leave initial value at None and warn.
              else:
                  raise ValueError(
                      'Stochastic ' +
                      self.__name__ +
                      "'s value initialized to None; no initial value or random method provided.")
  
          arguments = {}
          arguments.update(self.parents)
          arguments['value'] = self
          arguments = DictContainer(arguments)
  
          self._logp = LazyFunction(fun=self._logp_fun,
                                    arguments=arguments,
                                    ultimate_args=self.extended_parents | set(
                                        [self]),
                                    cache_depth=self._cache_depth)
          self._logp.force_compute()
  
          self._logp_partial_gradients = {}
  
          for parameter, function in six.iteritems(self._logp_partial_gradient_functions):
              lazy_logp_partial_gradient = LazyFunction(fun=function,
                                                        arguments=arguments,
                                                        ultimate_args=self.extended_parents | set(
                                                            [self]),
                                                        cache_depth=self._cache_depth)
              # lazy_logp_partial_gradient.force_compute()
              self._logp_partial_gradients[parameter] = lazy_logp_partial_gradient
docs: Will be called by Node at instantiation.