Return type:
      Hessian (Tensor or a tuple of tuple of Tensors)
-[ Example ]-



def pow_reducer(x):
   ...     return x.pow(3).sum()
inputs = torch.rand(2, 2)
hessian(pow_reducer, inputs)
   tensor([[[[5.2265, 0.0000],
             [0.0000, 0.0000]],
            [[0.0000, 4.8221],
             [0.0000, 0.0000]]],
           [[[0.0000, 0.0000],
             [1.9456, 0.0000]],
            [[0.0000, 0.0000],
             [0.0000, 3.2550]]]])
hessian(pow_reducer, inputs, create_graph=True)
   tensor([[[[5.2265, 0.0000],
             [0.0000, 0.0000]],
            [[0.0000, 4.8221],
             [0.0000, 0.0000]]],
           [[[0.0000, 0.0000],
             [1.9456, 0.0000]],
            [[0.0000, 0.0000],
             [0.0000, 3.2550]]]], grad_fn=)
def pow_adder_reducer(x, y):
   ...     return (2 * x.pow(2) + 3 * y.pow(2)).sum()
inputs = (torch.rand(2), torch.rand(2))
hessian(pow_adder_reducer, inputs)
   ((tensor([[4., 0.],


