to which to take diagonal. Default: 0.
  * **dim2** (*int**, **optional*) -- second dimension with
    respect to which to take diagonal. Default: 1.

Note:
 To take a batch diagonal, pass in dim1=-2, dim2=-1.

Examples:
  >>> a = torch.randn(3, 3)
  >>> a
  tensor([[-1.0854,  1.1431, -0.1752],
          [ 0.8536, -0.0905,  0.0360],
          [ 0.6927, -0.3735, -0.4945]])


  >>> torch.diagonal(a, 0)
  tensor([-1.0854, -0.0905, -0.4945])


  >>> torch.diagonal(a, 1)
  tensor([ 1.1431,  0.0360])


  >>> x = torch.randn(2, 5, 4, 2)
  >>> torch.diagonal(x, offset=-1, dim1=1, dim2=2)
  tensor([[[-1.2631,  0.3755, -1.5977, -1.8172],
           [-1.1065,  1.0401, -0.2235, -0.7938]],

          [[-1.7325, -0.3081,  0.6166,  0.2335],
           [ 1.0500,  0.7336, -0.3836, -1.1015]]])
