class_docstr: Backward-marginal implementation of product, using inclusion-exclusion.
class_docstr_tok: ["Backward-marginal","implementation","of","product",",","using","inclusion-exclusion","."]
code: def process(self, message):
      ring = self.ring
      term = self.term
      result = self.result()
      factors = [result]
      if message is not None:
          message._pyro_dims = result._pyro_dims
          factors.append(message)
      if term._pyro_backward.is_leaf:
          product = ring.sumproduct(factors, set())
          message = ring.broadcast(product, self.ordinal)
      else:
          factors.append(ring.inv(term))
          message = ring.sumproduct(factors, set())
      yield term._pyro_backward, message
  
imports: import weakref
  from abc import ABCMeta, abstractmethod
  import torch
  from pyro.ops.einsum import contract
  from pyro.ops.einsum.adjoint import SAMPLE_SYMBOL, Backward
  from pyro.util import ignore_jit_warnings
label_desc: Use image node_id 2 for calling the _MarginalProductBackward obj's underlying member method code with example usage: obj.process(message) without return types