code: def get_layers(
      module: nn.Module,
      layers=[Conv1D, nn.Conv2d, nn.Linear],
      prefix: Optional[str] = None,
      name: str = "",
  ):
      """
      Get all the layers with a specific prefix in the module
      Args:
          module (`nn.Module`):
              The module that contains our layers
          layers (`list`, defaults to `[Conv1D, nn.Conv2d, nn.Linear]`):
              Type of the layers that we want to get
          prefix (`Optional[str]`, defaults to `None`):
              Prefix of layers
          name (`str`, defaults to `""`):
              Used for recursion. Don't modify
  
      Returns:
          `Dict[str,Union[Conv1D, nn.Conv2d, nn.Linear]]`: Mapping of the name of the layer and the actual layer
      """
      for layer in layers:
          if isinstance(module, layer):
              if prefix is not None:
                  if name.startswith(prefix):
                      return {name: module}
              else:
                  return {name: module}
      res = {}
      for name1, child in module.named_children():
          res.update(
              get_layers(
                  child,
                  layers=layers,
                  prefix=prefix,
                  name=name + "." + name1 if name != "" else name1,
              )
          )
      return res
  
file_path: optimum/optimum/gptq/utils.py
imports: from logging import getLogger
  from typing import Optional, Union
  import torch
  from torch import nn
  from transformers.pytorch_utils import Conv1D
  from .constants import BLOCK_PATTERNS, SEQLEN_KEYS_TRANFORMERS
label_desc: Use image node_id 1 for calling a global function with example usage: get_layers(module, layers, prefix, name) and returns: res, dict, dict