code: def test_hessian_multi_variables():
      x = torch.randn(3, requires_grad=True)
      z = torch.randn(3, requires_grad=True)
      y = (x**2 * z + z**3).sum()
  
      H = hessian(y, (x, z))
      Hxx = (2 * z).diag()
      Hxz = (2 * x).diag()
      Hzz = (6 * z).diag()
      target_H = torch.cat(
          [torch.cat([Hxx, Hxz]), torch.cat([Hxz, Hzz])], dim=1
      )
      assert_equal(H, target_H)
  
imports: import torch
  import pyro.distributions
  from pyro.ops.hessian import hessian
  from tests.common import assert_equal
label_desc: Use image node_id 2 for calling a global function with example usage: test_hessian_multi_variables() without return types