code: def count_nonzero(
      a: Union[tf.Tensor, tf.Variable],
      /,
      *,
      axis: Optional[Union[int, Tuple[int, ...]]] = None,
      keepdims: bool = False,
      dtype: Optional[tf.DType] = None,
      out: Optional[Union[tf.Tensor, tf.Variable]] = None,
  ) -> Union[tf.Tensor, tf.Variable]:
      if dtype is None:
          return tf.math.count_nonzero(
              a, axis=axis, keepdims=keepdims, name=None
          )
      return tf.math.count_nonzero(
          a, axis=axis, keepdims=keepdims, dtype=dtype, name=None
      )
  
imports: import operator
  from typing import Union, Optional, Tuple, List, Sequence
  from numbers import Number
  import tensorflow
  from tensorflow.python.ops.numpy_ops import np_math_ops
  import ivy
  from ivy import promote_types_of_inputs
  from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
  from ..None import backend_version
label_desc: Use image node_id 8 for calling a global function with example usage: count_nonzero() and returns: tf, tf