code: def test_cuda_array_interface_pytorch():
      torch = pytest.importorskip("torch", minversion="1.6.0")
      if not torch.cuda.is_available():
          pytest.skip("need gpu version of pytorch to be installed")
  
      series = cudf.Series([1, -1, 10, -56])
      tensor = torch.tensor(series)
      got = cudf.Series(tensor)
  
      assert_eq(got, series)
      buffer = cudf.core.buffer.as_buffer(cupy.ones(10, dtype=np.bool_))
      tensor = torch.tensor(buffer)
      got = cudf.Series(tensor, dtype=np.bool_)
  
      assert_eq(got, cudf.Series(buffer, dtype=np.bool_))
  
      index = cudf.Index([], dtype="float64")
      tensor = torch.tensor(index)
      got = cudf.Index(tensor)
      assert_eq(got, index)
  
      index = cudf.core.index.RangeIndex(start=0, stop=100)
      tensor = torch.tensor(index)
      got = cudf.Series(tensor)
  
      assert_eq(got, cudf.Series(index))
  
      index = cudf.Index([1, 2, 8, 6])
      tensor = torch.tensor(index)
      got = cudf.Index(tensor)
  
      assert_eq(got, index)
  
      str_series = cudf.Series(["a", "g"])
  
      with pytest.raises(NotImplementedError):
          str_series.__cuda_array_interface__
  
      cat_series = str_series.astype("category")
  
      with pytest.raises(TypeError):
          cat_series.__cuda_array_interface__
  
file_path: cudf/python/cudf/cudf/tests/test_cuda_array_interface.py
imports: import types
  from contextlib import ExitStack
  import cupy
  import numpy
  import pandas
  import pytest
  from numba import cuda
  import cudf
  from cudf.core.buffer.spill_manager import get_global_manager
  from cudf.testing._utils import DATETIME_TYPES, NUMERIC_TYPES, assert_eq
label_desc: Use image node_id 7 for calling a global function with example usage: test_cuda_array_interface_pytorch() without return types