code: def test_count_nonzero(self, dtype):
      def func(xp):
          m = testing.shaped_random((2, 3), xp, xp.bool_)
          a = testing.shaped_random((2, 3), xp, dtype) * m
          c = xp.count_nonzero(a)
          if xp is cupy:
              # CuPy returns zero-dimensional array instead of
              # returning a scalar value
              assert isinstance(c, xp.ndarray)
              assert c.dtype == "l"
              assert c.shape == ()
          return int(c)
  
      assert func(numpy) == func(cupy)
  
file_path: cupy/tests/cupy_tests/sorting_tests/test_count.py
imports: import unittest
  import numpy
  import cupy
  from cupy import testing
label_desc: Use image node_id 1 for calling the TestCount obj's underlying member method code with example usage: obj.test_count_nonzero(dtype) and returns: int