code: def test_to_dense_batch_disable_dynamic_shapes():
      x = torch.tensor(
          [
              [1.0, 2.0],
              [3.0, 4.0],
              [5.0, 6.0],
              [7.0, 8.0],
              [9.0, 10.0],
              [11.0, 12.0],
          ]
      )
      batch = torch.tensor([0, 0, 1, 2, 2, 2])
  
      with set_experimental_mode(True, "disable_dynamic_shapes"):
          with pytest.raises(
              ValueError, match="'batch_size' needs to be set"
          ):
              out, mask = to_dense_batch(x, batch, max_num_nodes=6)
          with pytest.raises(
              ValueError, match="'max_num_nodes' needs to be"
          ):
              out, mask = to_dense_batch(x, batch, batch_size=4)
          with pytest.raises(
              ValueError, match="'batch_size' needs to be set"
          ):
              out, mask = to_dense_batch(x)
  
          out, mask = to_dense_batch(x, batch_size=1, max_num_nodes=6)
          assert out.size() == (1, 6, 2)
          assert mask.size() == (1, 6)
  
          out, mask = to_dense_batch(
              x, batch, batch_size=3, max_num_nodes=10
          )
          assert out.size() == (3, 10, 2)
          assert mask.size() == (3, 10)
  
file_path: pytorch_geometric/test/utils/test_to_dense_batch.py
imports: from typing import Tuple
  import pytest
  import torch
  from torch import Tensor
  from torch_geometric.experimental import set_experimental_mode
  from torch_geometric.testing import onlyFullTest
  from torch_geometric.utils import to_dense_batch
label_desc: Use image node_id 2 for calling a global function with example usage: test_to_dense_batch_disable_dynamic_shapes() without return types