class_docstr: Implements the max semiring (max, +, -inf, 0).
  
  Gradients give argmax.
code: def sum(xs, dim=-1):
      return torch.max(xs, dim=dim)[0]
  
imports: import torch
label_desc: Use image node_id 2 for calling the MaxSemiring obj's underlying member method code with example usage: obj.sum(xs, dim) and returns: torch