code: def test_hawkesll_backward_correct():
      ctx = mx.cpu()
  
      mu = nd.array([1.5, 2.0, 3.0])
      alpha = nd.array([0.2, 0.3, 0.4])
      beta = nd.array([2.0, 2.0, 2.0])
  
      T, N, K = 9, 2, 3
      lags = nd.array(
          [[6, 7, 8, 9, 3, 2, 5, 1, 7], [1, 2, 3, 4, 2, 1, 2, 1, 4]]
      )
      marks = nd.array(
          [[0, 0, 0, 1, 0, 0, 1, 2, 0], [1, 2, 0, 0, 0, 2, 2, 1, 0]]
      ).astype(np.int32)
      valid_length = nd.array([9, 9])
      states = nd.zeros((N, K))
  
      max_time = nd.ones((N,)) * 100.0
  
      mu.attach_grad()
      alpha.attach_grad()
      beta.attach_grad()
  
      with mx.autograd.record():
          A, _ = nd.contrib.hawkesll(
              mu.tile((N, 1)),
              alpha,
              beta,
              states,
              lags,
              marks,
              valid_length,
              max_time,
          )
      A.backward()
  
      dmu, dalpha, dbeta = (
          np.array([-193.33987481, -198.0, -198.66828681]),
          np.array([-9.95093892, -4.0, -3.98784892]),
          np.array([-1.49052169e-02, -5.87469511e-09, -7.29065224e-03]),
      )
      assert np.allclose(dmu, mu.grad.asnumpy())
      assert np.allclose(dalpha, alpha.grad.asnumpy())
      assert np.allclose(dbeta, beta.grad.asnumpy())
  
imports: import mxnet
  import numpy
  from mxnet import nd
label_desc: Use image node_id 3 for calling a global function with example usage: test_hawkesll_backward_correct() without return types