code: def score(self, potentials, parts, batch_dims=[0]):
      score = torch.mul(potentials, parts)
      batch = tuple((score.shape[b] for b in batch_dims))
      return self.semiring.prod(score.view(batch + (-1,)))
  
file_path: pytorch-struct/torch_struct/helpers.py
imports: import torch
  import math
  from .semirings import LogSemiring
label_desc: Use image node_id 2 for calling the _Struct obj's underlying member method code with example usage: obj.score(potentials, parts, batch_dims) and returns: self