class_docstr: Base semiring class.
  
  Based on description in:
  
  * Semiring parsing :cite:`goodman1999semiring`
docstr: Dot product along last dim.
docstr_tok: ["Dot","product","along","last","dim","."]
code: def dot(cls, a, b):
      "Dot product along last dim."
      a = a.unsqueeze(-2)
      b = b.unsqueeze(-1)
      return cls.matmul(a, b).squeeze(-1).squeeze(-1)
  
imports: import torch
label_desc: Use image node_id 3 for calling the Semiring obj's underlying member method code with example usage: obj.dot(cls, a, b) and returns: cls