code: def test_trim_to_layer():
      x = torch.randn(14, 16)
      edge_index = torch.tensor(
          [
              [2, 3, 4, 5, 7, 7, 10, 11, 12, 13],
              [0, 1, 2, 3, 2, 3, 7, 7, 7, 7],
          ]
      )
      data = Data(x=x, edge_index=edge_index)
  
      loader = NeighborLoader(
          data,
          num_neighbors=[1, 2, 4],
          batch_size=2,
          shuffle=False,
      )
      batch = next(iter(loader))
  
      model = GraphSAGE(
          in_channels=16, hidden_channels=16, num_layers=3
      )
      out1 = model(batch.x, batch.edge_index)[:2]
      assert out1.size() == (2, 16)
  
      out2 = model(
          batch.x,
          batch.edge_index,
          num_sampled_nodes_per_hop=batch.num_sampled_nodes,
          num_sampled_edges_per_hop=batch.num_sampled_edges,
      )[:2]
      assert out2.size() == (2, 16)
  
      assert torch.allclose(out1, out2)
  
imports: import os
  import os.path
  import random
  import sys
  import warnings
  import pytest
  import torch
  import torch.nn.functional
  import torch_geometric.typing
  from torch_geometric.data import Data
  from torch_geometric.loader import NeighborLoader
  from torch_geometric.nn import SAGEConv
  from torch_geometric.nn.models import GAT, GCN, GIN, PNA, EdgeCNN, GraphSAGE
  from torch_geometric.profile import benchmark
  from torch_geometric.testing import onlyFullTest, onlyLinux, onlyNeighborSampler, onlyOnline, withCUDA, withPackage
label_desc: Use image node_id 14 for calling a global function with example usage: test_trim_to_layer() without return types