code: def eigh(
      x: Union[tf.Tensor, tf.Variable],
      /,
      *,
      UPLO: str = "L",
      out: Optional[Union[tf.Tensor, tf.Variable]] = None,
  ) -> Tuple[Union[tf.Tensor, tf.Variable]]:
      if UPLO not in ("L", "U"):
          raise ValueError("UPLO argument must be 'L' or 'U'")
      result_tuple = NamedTuple(
          "eigh",
          [
              ("eigenvalues", Union[tf.Tensor, tf.Variable]),
              ("eigenvectors", Union[tf.Tensor, tf.Variable]),
          ],
      )
  
      if UPLO == "L":
          eigenvalues, eigenvectors = tf.linalg.eigh(x)
  
      elif UPLO == "U":
          axes = list(range(len(x.shape) - 2)) + [
              len(x.shape) - 1,
              len(x.shape) - 2,
          ]
          eigenvalues, eigenvectors = tf.linalg.eigh(
              tf.transpose(x, perm=axes)
          )
      return result_tuple(eigenvalues, eigenvectors)
  
imports: from typing import Union, Optional, Tuple, Literal, List, NamedTuple, Sequence
  from collections import namedtuple
  import tensorflow
  from tensorflow.python.framework.dtypes import DType
  import ivy
  from ivy import inf
  from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
  from .None import backend_version
label_desc: Use image node_id 6 for calling a global function with example usage: eigh() and returns: result_tuple