def METHOD_NAME(num_nodes, dtype, bp_iters):
    pytest.importorskip("lap")
    logits = torch.randn(num_nodes, num_nodes, dtype=dtype) * 10
    d = dist.OneOneMatching(logits, bp_iters=bp_iters)
    # Compute an empirical mean.
    num_samples = 1000
    s = torch.arange(num_nodes)
    actual = torch.zeros_like(logits)
    with xfail_if_not_implemented():
        for v in d.sample([num_samples]):
            actual[s, v] += 1 / num_samples
    # Compute truth via enumeration.
    values = d.enumerate_support()
    probs = d.log_prob(values).exp()
    probs /= probs.sum()
    expected = torch.zeros(num_nodes, num_nodes)
    for v, p in zip(values, probs):
        expected[s, v] += p
    assert_close(actual, expected, atol=0.1)