code: def sum(xs, dim=-1):
      return torch.max(xs, dim=dim)[0]
  
file_path: pytorch-struct/torch_struct/semirings/fast_semirings.py
imports: import torch
  import torch.distributions
  from .semirings import _BaseLog
  from .sample import _SampledLogSumExp
label_desc: Use image node_id 1 for calling the FastMaxSemiring obj's underlying member method code with example usage: obj.sum(xs, dim) and returns: torch