code: def svd(
      x: Union[tf.Tensor, tf.Variable],
      /,
      *,
      full_matrices: bool = True,
      compute_uv: bool = True,
  ) -> Union[
      Union[tf.Tensor, tf.Variable],
      Tuple[Union[tf.Tensor, tf.Variable], ...],
  ]:
      if compute_uv:
          results = namedtuple("svd", "U S Vh")
  
          batch_shape = tf.shape(x)[:-2]
          num_batch_dims = len(batch_shape)
          transpose_dims = list(range(num_batch_dims)) + [
              num_batch_dims + 1,
              num_batch_dims,
          ]
          D, U, V = tf.linalg.svd(
              x, full_matrices=full_matrices, compute_uv=compute_uv
          )
          VT = tf.transpose(V, transpose_dims)
          return results(U, D, VT)
      else:
          results = namedtuple("svd", "S")
          D = tf.linalg.svd(
              x, full_matrices=full_matrices, compute_uv=compute_uv
          )
          return results(D)
  
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 20 for calling a global function with example usage: svd() and returns: results, results