code: def argmax(
      x: Union[tf.Tensor, tf.Variable],
      /,
      *,
      axis: Optional[int] = None,
      keepdims: bool = False,
      dtype: Optional[Union[ivy.Dtype, ivy.NativeDtype]] = None,
      select_last_index: bool = False,
      out: Optional[Union[tf.Tensor, tf.Variable]] = None,
  ) -> Union[tf.Tensor, tf.Variable]:
      n_dims = tf.rank(x).numpy()
      if axis is None:
          x = tf.reshape(x, [-1])
      if select_last_index:
          x = tf.experimental.numpy.flip(x, axis=axis)
          ret = tf.argmax(x, axis=axis)
          if axis is not None:
              ret = x.shape[axis] - ret - 1
          else:
              ret = tf.size(x, out_type=tf.int64) - ret - 1
      else:
          ret = tf.argmax(x, axis=axis)
  
      if keepdims:
          if axis is None:
              ret = tf.reshape(ret, [1] * n_dims)
          else:
              ret = tf.expand_dims(ret, axis)
  
      return tf.cast(ret, dtype) if dtype is not None else ret
  
file_path: ivy/ivy/functional/backends/tensorflow/searching.py
imports: from numbers import Number
  from typing import Optional, Union, Tuple
  import tensorflow
  import ivy
  from ivy.func_wrapper import with_unsupported_dtypes
  from .None import backend_version
label_desc: Use image node_id 1 for calling a global function with example usage: argmax() and returns: unknown