code: def test_flat_vs_persistent(num_objects, num_frames, bp_iters):
      exists_logits = -2 * torch.rand(num_objects)
      assign_logits = -2 * torch.rand(num_frames, num_objects)
      flat = MarginalAssignment(exists_logits, assign_logits, bp_iters)
      full = MarginalAssignmentPersistent(
          exists_logits, assign_logits.unsqueeze(1), bp_iters
      )
      assert_equal(flat.exists_dist.probs, full.exists_dist.probs)
      assert_equal(
          flat.assign_dist.probs, full.assign_dist.probs.squeeze(1)
      )
  
imports: import logging
  import pytest
  import torch
  from torch.autograd import grad
  import pyro
  import pyro.distributions
  from pyro.contrib.tracking.assignment import MarginalAssignment, MarginalAssignmentPersistent, MarginalAssignmentSparse
  from tests.common import assert_equal
label_desc: Use image node_id 14 for calling a global function with example usage: test_flat_vs_persistent(num_objects, num_frames, bp_iters) without return types