code: def triu_inverse(x):
      """
      EXPERIMENTAL Computes the inverse of an upper-triangular arrowhead matrix.
  
      :param TriuArrowhead x: an upper-triangular arrowhead matrix.
      :return: the inverse of `x`
      :rtype: TriuArrowhead
      """
      assert isinstance(x, TriuArrowhead)
      head_size = x.top.size(0)
      if head_size == 0:
          return TriuArrowhead(x.top, x.bottom_diag.reciprocal())
  
      A, B = x.top[:, :head_size], x.top[:, head_size:]
      B_Dinv = B / x.bottom_diag.unsqueeze(-2)
  
      identity = torch.eye(head_size, dtype=A.dtype, device=A.device)
      top_left = torch.linalg.solve_triangular(A, identity, upper=True)
      top_right = -top_left.matmul(
          B_Dinv
      )  # complexity: head_size^2 x N
      top = torch.cat([top_left, top_right], -1)
      bottom_diag = x.bottom_diag.reciprocal()
      return TriuArrowhead(top, bottom_diag)
  
imports: from collections import namedtuple
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: triu_inverse(x) and returns: TriuArrowhead, TriuArrowhead