code: def matrix_rank(a, tol=None, validate_args=False, name=None):
      # TODO:The tests will fail because output shapes mismatch
      # DO NOT for any reason change anything with the backend function
      # all the fixes must be here as the backend function is
      # working as expected and in compliance with Array API
      return ivy.astype(ivy.matrix_rank(a, atol=tol), ivy.int32)
  
imports: import ivy
  from ivy.functional.frontends.tensorflow import check_tensorflow_casting
  from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
  from ivy.functional.frontends.tensorflow.func_wrapper import to_ivy_arrays_and_back, handle_tf_dtype
  import ivy.functional.frontends.tensorflow
label_desc: Use image node_id 21 for calling a global function with example usage: matrix_rank(a, tol, validate_args, name) and returns: ivy