code: def test_pin_memory():
      x = torch.randn(3, 16)
      edge_index = torch.tensor([[0, 1, 1, 2], [1, 0, 2, 1]])
      data = Data(x=x, edge_index=edge_index)
  
      loader = DataLoader([data] * 4, batch_size=2, pin_memory=True)
      for batch in loader:
          assert batch.x.is_pinned() or not torch.cuda.is_available()
          assert (
              batch.edge_index.is_pinned()
              or not torch.cuda.is_available()
          )
  
file_path: pytorch_geometric/test/loader/test_dataloader.py
imports: import multiprocessing
  import sys
  from collections import namedtuple
  import pytest
  import torch
  from torch_geometric import EdgeIndex
  from torch_geometric.data import Data, HeteroData, OnDiskDataset
  from torch_geometric.loader import DataLoader
  from torch_geometric.testing import get_random_edge_index, get_random_tensor_frame, withCUDA, withPackage
label_desc: Use image node_id 5 for calling a global function with example usage: test_pin_memory() without return types