code: def logp_gradient(variable, calculation_set=None):
      
      return variable.logp_partial_gradient(variable, calculation_set) + sum(
          [child.logp_partial_gradient(variable, calculation_set) for child in variable.children])
docs: Calculates the gradient of the joint log posterior with respect to variable.
      Calculation of the log posterior is restricted to the variables in calculation_set.