code: def _svd_checks(x, n_eigenvecs=None):
      """Run common checks to all of the SVD methods.
  
      Parameters
      ----------
      matrix : 2D-array
      n_eigenvecs : int, optional, default is None
          if specified, number of eigen[vectors-values] to return
  
      Returns
      -------
      n_eigenvecs : int
          the number of eigenvectors to solve for
      min_dim : int
          the minimum dimension of matrix
      max_dim : int
          the maximum dimension of matrix
      """
      # ndims = len(x.shape)
      # if ndims != 2:
      #    raise ValueError(f"matrix be a matrix. matrix.ndim is {ndims} != 2")
  
      dim_1, dim_2 = ivy.shape(x)[-2:]
      min_dim, max_dim = min(dim_1, dim_2), max(dim_1, dim_2)
  
      if n_eigenvecs is None:
          n_eigenvecs = max_dim
  
      if n_eigenvecs > max_dim:
          logging.warning(
              f"Trying to compute SVD with n_eigenvecs={n_eigenvecs}, which is larger "
              f"than max(matrix.shape)={max_dim}. Setting n_eigenvecs to {max_dim}."
          )
          n_eigenvecs = max_dim
  
      return n_eigenvecs, min_dim, max_dim
  
imports: import logging
  from typing import Union, Optional, Tuple, List, Sequence, Literal
  import ivy
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_array_function, handle_device, inputs_to_ivy_arrays, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 16 for calling a global function with example usage: _svd_checks(x, n_eigenvecs) and returns: n_eigenvecs,  min_dim,  max_dim