code: def _collect_layer_specific_params(model: PreTrainedModel):
      base_model = getattr(model, model.base_model_prefix)
  
      layers = []
      if hasattr(base_model, "embeddings"):
          layers.append(base_model.embeddings.parameters())
  
      if hasattr(base_model, "encoder"):
          if hasattr(base_model.encoder, "layer"):
              layers += [
                  layer.parameters()
                  for layer in base_model.encoder.layer
              ]
      else:
          layers += [
              layer.parameters()
              for layer in base_model.transformer.layer
          ]
  
      if (
          hasattr(base_model, "pooler")
          and base_model.pooler is not None
      ):
          layers.append(base_model.pooler.parameters())
      if hasattr(model, "classifier"):
          layers.append(model.classifier.parameters())
  
      return layers
  
file_path: small-text/small_text/integrations/transformers/utils/classification.py
imports: import os
  from typing import List
  from transformers import logging
  from transformers import AutoConfig, AutoModelForSequenceClassification, AutoTokenizer, PreTrainedModel
  from small_text.integrations.transformers.classifiers.base import ModelLoadingStrategy, PretrainedModelLoadingArguments
label_desc: Use image node_id 4 for calling a global function with example usage: _collect_layer_specific_params(model) and returns: layers