code: def test_non_proj(model_test, semiring, data):
      gen = Gen(model_test, data, semiring)
      alpha = deptree_part(gen.vals, False)
      count = gen.test.enumerate(
          LogSemiring, gen.vals, non_proj=True, multi_root=False
      )[0]
  
      assert alpha.shape[0] == gen.batch
      assert count.shape[0] == gen.batch
      assert alpha.shape == count.shape
      # assert torch.isclose(count[0], alpha[0], 1e-2)
  
      alpha = deptree_part(gen.vals, True)
      count = gen.test.enumerate(
          LogSemiring, gen.vals, non_proj=True, multi_root=True
      )[0]
  
      assert alpha.shape[0] == gen.batch
      assert count.shape[0] == gen.batch
      assert alpha.shape == count.shape
      # assert torch.isclose(count[0], alpha[0], 1e-2)
  
      marginals = deptree_nonproj(gen.vals, multi_root=False)
      print(marginals.sum(1))
      marginals = deptree_nonproj(gen.vals, multi_root=True)
      print(marginals.sum(1))
  
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 17 for calling a global function with example usage: test_non_proj(model_test, semiring, data) without return types