def METHOD_NAME(num_edges, backend):
    pyro.set_rng_seed(2**32 - num_edges)
    E = num_edges
    V = 1 + E
    K = V * (V - 1) // 2
    edge_logits = torch.randn(K)
    d = SpanningTree(edge_logits, sampler_options={"backend": backend})
    with xfail_if_not_implemented():
        support = d.enumerate_support()
    v1 = support[..., 0]
    v2 = support[..., 1]
    k = v1 + v2 * (v2 - 1) // 2
    expected = support[edge_logits[k].sum(-1).argmax(0)]
    actual = d.mode
    assert (actual == expected).all()