product of the rest.
Examples:
  >>> A = torch.eye(4 * 6).reshape((4, 6, 8, 3))
  >>> Ainv = torch.linalg.tensorinv(A, ind=2)
  >>> Ainv.shape
  torch.Size([8, 3, 4, 6])
  >>> B = torch.randn(4, 6)
  >>> torch.allclose(torch.tensordot(Ainv, B), torch.linalg.tensorsolve(A, B))
  True

  >>> A = torch.randn(4, 4)
  >>> Atensorinv = torch.linalg.tensorinv(A, ind=1)
  >>> Ainv = torch.linalg.inverse(A)
  >>> torch.allclose(Atensorinv, Ainv)
  True
