code: def logp_gradient_contribution(self, calculation_set=None):
          
          # NEED some sort of check to see if the log p calculation has recently
          # failed, in which case not to continue
  
          return self.logp_partial_gradient(self, calculation_set) + builtins.sum(
              [child.logp_partial_gradient(self, calculation_set) for child in self.children])
docs: Calculates the gradient of the joint log posterior with respect to self.
          Calculation of the log posterior is restricted to the variables in calculation_set.