class_docstr: Represents a projective dependency CRF.
  
  Reference:
  
  * Bilexical grammars and their cubic-time parsing algorithms :cite:`eisner2000bilexical`
  
  Event shape is of the form:
  
  Parameters:
     log_potentials (tensor) : event shape (*N x N*) head, child or (*N x N x L*) head,
                               child, labels with arc scores with root scores on diagonal
                               e.g. :math:`\phi(i, j)` where :math:`\phi(i, i)` is (root, i).
     lengths (long tensor) : batch shape integers for length masking.
  
  
  Compact representation: N long tensor in [0, .. N] (indexing is +1)
  
  Implementation uses linear-scan, forward-pass only.
  
  * Parallel Time: :math:`O(N)` parallel merges.
  * Forward Memory: :math:`O(N \log(N) C^2 K^2)`
code: def __init__(
      self,
      log_potentials,
      lengths=None,
      args={},
      multiroot=True,
      validate_args=False,
  ):
      super(DependencyCRF, self).__init__(
          log_potentials, lengths, args, validate_args=validate_args
      )
      self.struct = DepTree
      setattr(self.struct, "multiroot", multiroot)
  
imports: import torch
  from torch.distributions import constraints
  from torch.distributions.distribution import Distribution
  from torch.distributions.utils import lazy_property
  from .linearchain import LinearChain
  from .cky import CKY
  from .semimarkov import SemiMarkov
  from .alignment import Alignment
  from .deptree import DepTree, deptree_nonproj, deptree_part
  from .cky_crf import CKY_CRF
  from .semirings import LogSemiring, MaxSemiring, EntropySemiring, CrossEntropySemiring, KLDivergenceSemiring, MultiSampledSemiring, KMaxSemiring, StdSemiring, GumbelCRFSemiring
label_desc: Use image node_id 1 to create a new DependencyCRF object from inherited base classes: StructDistribution with example: obj = DependencyCRF(log_potentials, lengths, args, multiroot, validate_args)