code: def test_dataloader_fallbacks():
      # Test inputs of type List[torch.Tensor]:
      data_list = [torch.ones(3) for _ in range(4)]
      batch = next(iter(DataLoader(data_list, batch_size=4)))
      assert torch.equal(batch, torch.ones(4, 3))
  
      # Test inputs of type List[float]:
      data_list = [1.0, 1.0, 1.0, 1.0]
      batch = next(iter(DataLoader(data_list, batch_size=4)))
      assert torch.equal(batch, torch.ones(4))
  
      # Test inputs of type List[int]:
      data_list = [1, 1, 1, 1]
      batch = next(iter(DataLoader(data_list, batch_size=4)))
      assert torch.equal(batch, torch.ones(4, dtype=torch.long))
  
      # Test inputs of type List[str]:
      data_list = ["test"] * 4
      batch = next(iter(DataLoader(data_list, batch_size=4)))
      assert batch == data_list
  
      # Test inputs of type List[Mapping]:
      data_list = [{"x": torch.ones(3), "y": 1}] * 4
      batch = next(iter(DataLoader(data_list, batch_size=4)))
      assert torch.equal(batch["x"], torch.ones(4, 3))
      assert torch.equal(batch["y"], torch.ones(4, dtype=torch.long))
  
      # Test inputs of type List[Tuple]:
      DataTuple = namedtuple("DataTuple", "x y")
      data_list = [DataTuple(0.0, 1)] * 4
      batch = next(iter(DataLoader(data_list, batch_size=4)))
      assert torch.equal(batch.x, torch.zeros(4))
      assert torch.equal(batch[1], torch.ones(4, dtype=torch.long))
  
      # Test inputs of type List[Sequence]:
      data_list = [[0.0, 1]] * 4
      batch = next(iter(DataLoader(data_list, batch_size=4)))
      assert torch.equal(batch[0], torch.zeros(4))
      assert torch.equal(batch[1], torch.ones(4, dtype=torch.long))
  
      # Test that inputs of unsupported types raise an error:
      class DummyClass:
          pass
  
      with pytest.raises(TypeError):
          data_list = [DummyClass()] * 4
          next(iter(DataLoader(data_list, batch_size=4)))
  
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 3 for calling a global function with example usage: test_dataloader_fallbacks() without return types