code: def trim_feat(
      x: Tensor, layer: int, num_samples_per_hop: List[int]
  ) -> Tensor:
      if layer <= 0:
          return x
  
      return x.narrow(
          dim=0,
          start=0,
          length=x.size(0) - num_samples_per_hop[-layer],
      )
  
file_path: pytorch_geometric/torch_geometric/utils/_trim_to_layer.py
imports: import copy
  from typing import Any, Dict, List, Optional, Tuple, Union, overload
  import torch
  from torch import Tensor
  from torch_geometric.typing import Adj, EdgeType, MaybeHeteroAdjTensor, MaybeHeteroEdgeTensor, MaybeHeteroNodeTensor, NodeType, SparseStorage, SparseTensor
label_desc: Use image node_id 5 for calling a global function with example usage: trim_feat(x, layer, num_samples_per_hop) and returns: x, x