code: def test_dataloader_on_disk_dataset(tmp_path, num_workers):
      dataset = OnDiskDataset(tmp_path)
      data1 = Data(x=torch.randn(3, 8))
      data2 = Data(x=torch.randn(4, 8))
      dataset.extend([data1, data2])
  
      loader = DataLoader(
          dataset, batch_size=2, num_workers=num_workers
      )
      assert len(loader) == 1
      batch = next(iter(loader))
      assert batch.num_nodes == 7
      assert torch.equal(batch.x, torch.cat([data1.x, data2.x], dim=0))
      assert batch.batch.tolist() == [0, 0, 0, 1, 1, 1, 1]
  
      dataset.close()
  
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 2 for calling a global function with example usage: test_dataloader_on_disk_dataset(tmp_path, num_workers) without return types