code: def finv(wsh):
      """Inverse transform 1
  
      This method takes a block matrix representing a complex Hermitian
      matrix and converts it to a complex matrix represented by its
      upper triangular part. The result will have the following format:
      (*,2,C+P)
  
      Arguments
      ---------
      wsh : tensor
          An input matrix. The tensor must have the following format:
          (*,2C,2C)
      """
  
      # Dimensions
      D = wsh.dim()
      C = int(wsh.shape[D - 1] / 2)
      P = int(C * (C + 1) / 2)
  
      # Output matrix
      ws = torch.zeros(
          wsh.shape[0 : (D - 2)] + (2, P),
          dtype=wsh.dtype,
          device=wsh.device,
      )
      ids = torch.triu_indices(C, C)
      ws[..., 0, :] = wsh[..., ids[0] * 2, ids[1] * 2]
      ws[..., 1, :] = -1 * wsh[..., ids[0] * 2, ids[1] * 2 + 1]
  
      return ws
  
file_path: speechbrain/speechbrain/processing/decomposition.py
imports: import torch
label_desc: Use image node_id 4 for calling a global function with example usage: finv(wsh) and returns: ws