class_docstr: Helper class for tests
code: def __init__(self, model_test, data, semiring):
      model_test = algorithms[model_test]
      self.data = data
      self.model = model_test[0]
      self.struct = self.model(semiring)
      self.test = model_test[1]
      self.vals, (self.batch, self.N) = data.draw(
          self.test.logpotentials()
      )
      # jitter
      if not isinstance(self.vals, tuple):
          self.vals = self.vals + 1e-6 * torch.rand(*self.vals.shape)
      self.semiring = semiring
  
imports: from torch_struct import CKY, CKY_CRF, DepTree, LinearChain, SemiMarkov, Alignment, deptree_nonproj, deptree_part
  from torch_struct import LogSemiring, CheckpointSemiring, CheckpointShardSemiring, KMaxSemiring, SparseMaxSemiring, MaxSemiring, StdSemiring, EntropySemiring
  from .extensions import LinearChainTest, SemiMarkovTest, DepTreeTest, CKYTest, CKY_CRFTest, test_lookup
  import torch
  from hypothesis import given
  from hypothesis.strategies import integers, data, sampled_from
  import pytest
  from hypothesis import settings
label_desc: Use image node_id 1 to create a new Gen object  with example: obj = Gen(model_test, data, semiring)