code: def test_grad_hard(num_destins):
      num_sources = 2 * num_destins
      i = torch.arange(num_sources)[:, None]
      j = torch.arange(num_destins)
      logits = torch.randn(num_sources, num_destins) * 10
      logits[i < j] = -100
      logits.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 12 for calling a global function with example usage: test_grad_hard(num_destins) without return types