code: def test_array_function(self):
      a = numpy.random.randn(100, 100)
      a_cpu = numpy.asarray(a)
      a_gpu = cupy.asarray(a)
  
      # The numpy call for both CPU and GPU arrays is intentional to test the
      # __array_function__ protocol
      qr_cpu = numpy.linalg.qr(a_cpu)
      qr_gpu = numpy.linalg.qr(a_gpu)
  
      if isinstance(qr_cpu, tuple):
          for b_cpu, b_gpu in zip(qr_cpu, qr_gpu):
              assert b_cpu.dtype == b_gpu.dtype
              cupy.testing.assert_allclose(b_cpu, b_gpu, atol=1e-4)
      else:
          assert qr_cpu.dtype == qr_gpu.dtype
          cupy.testing.assert_allclose(qr_cpu, qr_gpu, atol=1e-4)
  
file_path: cupy/tests/cupy_tests/core_tests/test_array_function.py
imports: import unittest
  import numpy
  import cupy
  from cupy import testing
label_desc: Use image node_id 1 for calling the TestArrayFunction obj's underlying member method code with example usage: obj.test_array_function() without return types