code: def sparsify_tensor(
      x: Union[ivy.Array, ivy.NativeArray],
      card: int,
      /,
      *,
      out: Optional[ivy.Array] = None,
  ) -> ivy.Array:
      """Zeros out all elements in the tensor except `card` elements with maximum
      absolute values.
  
      Parameters
      ----------
      x
          Tensor to be sparsified
      card
          Desired number of non-zero elements in the tensor
      out
          Optional output array for writing the result to.
  
      Returns
      -------
      ivy.array of shape tensor.shape
  
      Examples
      --------
      >>> x = ivy.arange(100)
      >>> x = ivy.reshape(x, (10, 10))
      >>> sparsify_tensor(x, 10)
      ivy.array([[ 0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
      [ 0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
      [ 0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
      [ 0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
      [ 0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
      [ 0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
      [ 0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
      [ 0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
      [ 0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
      [90, 91, 92, 93, 94, 95, 96, 97, 98, 99]])
      """
      if card >= ivy.prod(ivy.array(x.shape)):
          return ivy.inplace_update(out, x) if ivy.exists(out) else x
      _shape = ivy.shape(x)
      x = ivy.reshape(ivy.sort(ivy.abs(x)), (-1,))
      tensor = ivy.concat(
          [ivy.zeros(len(x) - card, dtype=x.dtype), x[-card:]], axis=0
      )
  
      return ivy.reshape(tensor, _shape, out=out)
  
imports: from typing import Optional, Union, Tuple, List, Sequence
  from numbers import Number
  import ivy
  from ivy.func_wrapper import handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_partial_mixed_function, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_array_function, infer_dtype, handle_device, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 27 for calling a global function with example usage: sparsify_tensor() and returns: ivy, unknown