code: def svd(
      x: torch.Tensor,
      /,
      *,
      full_matrices: bool = True,
      compute_uv: bool = True,
  ) -> Union[torch.Tensor, Tuple[torch.Tensor, ...]]:
      if compute_uv:
          results = namedtuple("svd", "U S Vh")
  
          U, D, VT = torch.linalg.svd(x, full_matrices=full_matrices)
          return results(U, D, VT)
      else:
          results = namedtuple("svd", "S")
          svd = torch.linalg.svd(x, full_matrices=full_matrices)
          # torch.linalg.svd returns a tuple with U, S, and Vh
          D = svd[1]
          return results(D)
  
imports: import torch
  from typing import Union, Optional, Tuple, Literal, List, NamedTuple, Sequence
  from collections import namedtuple
  import ivy
  from ivy import inf
  from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
  from .None import backend_version
  from .elementwise import _cast_for_unary_op
label_desc: Use image node_id 21 for calling a global function with example usage: svd() and returns: results, results