code: def nonzero(
      x: Union[tf.Tensor, tf.Variable],
      /,
      *,
      as_tuple: bool = True,
      size: Optional[int] = None,
      fill_value: Number = 0,
  ) -> Union[
      tf.Tensor, tf.Variable, Tuple[Union[tf.Tensor, tf.Variable]]
  ]:
      res = tf.experimental.numpy.nonzero(x)
  
      if size is not None:
          dtype = tf.int64
          if isinstance(fill_value, float):
              dtype = tf.float64
          res = tf.cast(res, dtype)
  
          diff = size - res[0].shape[0]
          if diff > 0:
              res = tf.pad(
                  res, [[0, 0], [0, diff]], constant_values=fill_value
              )
          elif diff < 0:
              res = tf.slice(res, [0, 0], [-1, size])
  
      if as_tuple:
          return tuple(res)
      return tf.stack(res, axis=1)
  
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 3 for calling a global function with example usage: nonzero() and returns: tf, tuple