code: def logpartition(
      self, log_potentials, lengths=None, force_grad=False, cache=True
  ):
      return self._dp_scan(log_potentials, lengths, force_grad)
  
file_path: pytorch-struct/torch_struct/alignment.py
imports: import torch
  from .helpers import _Struct
  import math
  from .semirings import LogSemiring
  from .semirings.fast_semirings import broadcast
label_desc: Use image node_id 3 for calling the Alignment obj's underlying member method code with example usage: obj.logpartition(log_potentials, lengths, force_grad, cache) and returns: self