class_docstr: Implements an entropy expectation semiring.
  
  Computes both the log-values and the running distributional entropy.
  
  Based on descriptions in:
  
  * Parameter estimation for probabilistic finite-state transducers :cite:`eisner2002parameter`
  * First-and second-order expectation semirings with applications to minimum-risk training on translation forests :cite:`li2009first`
  * Sample Selection for Statistical Grammar Induction :cite:`hwa2000samplesf`
code: def prod(cls, xs, dim=-1):
      return xs.sum(dim)
  
imports: import torch
label_desc: Use image node_id 6 for calling the EntropySemiring obj's underlying member method code with example usage: obj.prod(cls, xs, dim) and returns: xs