code: def test_stream_capture_failure_cusparse(self):
      s = cupy.cuda.Stream(non_blocking=True)
      a = cupy.zeros((3, 4))
      a[0] = 1
      a = cupyx.scipy.sparse.csr_matrix(a)
      a.has_canonical_format  # avoid launching custom kernels during capture
  
      with s:
          s.begin_capture()
          with pytest.raises(NotImplementedError) as e:
              a * a.T
          assert "cuSPARSE" in str(e.value)
          s.end_capture()
  
      # check s left the capture mode and permits normal usage
      assert not s.is_capturing()
      s.synchronize()
  
imports: import pytest
  import cupy
  from cupy import cuda
  from cupy import testing
  import cupyx
label_desc: Use image node_id 19 for calling the TestGraph obj's underlying member method code with example usage: obj.test_stream_capture_failure_cusparse() without return types