class_docstr: edge : b x N x K x C x C semimarkov potentials
code: def _check_potentials(self, edge, lengths=None):
      batch, N_1, K, C, C2 = self._get_dimension(edge)
      edge = self.semiring.convert(edge)
      N = N_1 + 1
      if lengths is None:
          lengths = torch.LongTensor([N] * batch).to(edge.device)
      assert max(lengths) <= N, "Length longer than edge scores"
      assert max(lengths) == N, "At least one in batch must be length N"
      assert C == C2, "Transition shape doesn't match"
      return edge, batch, N, K, C, lengths
  
file_path: pytorch-struct/torch_struct/semimarkov.py
imports: import torch
  from .helpers import _Struct
label_desc: Use image node_id 1 for calling the SemiMarkov obj's underlying member method code with example usage: obj._check_potentials(edge, lengths) and returns: edge,  batch,  N,  K,  C,  lengths