code: def test_grad_phylo(num_leaves):
      logits, times = random_phylo_logits(num_leaves, torch.double)
      logits = logits.detach().requires_grad_()
  
      assert_grads_ok(logits)
      assert_grads_ok(logits, bp_iters=BP_ITERS)
      assert_grads_agree(logits)
  
imports: import logging
  import math
  import pytest
  import torch
  import pyro.distributions
  from tests.common import assert_close, assert_equal, xfail_if_not_implemented
label_desc: Use image node_id 13 for calling a global function with example usage: test_grad_phylo(num_leaves) without return types