docstr: Resizes position embeddings of the model if :obj:`new_num_position_embeddings !=
  config.max_position_embeddings`.
  
  Arguments:
      new_num_position_embeddings (:obj:`int`):
          The number of new position embedding matrix. If position embeddings are learned, increasing the size
          will add newly initialized vectors at the end, whereas reducing the size will remove vectors from the
          end. If position embeddings are not learned (*e.g.* sinusoidal position embeddings), increasing the
          size will add correct vectors at the end following the position encoding algorithm, whereas reducing
          the size will remove vectors from the end.
docstr_tok: ["Resizes","position","embeddings","of","the","model","if",":","obj",":","`","new_num_position_embeddings","!","=","config.max_position_embeddings","`",".","Arguments",":","new_num_position_embeddings","(",":","obj",":","`","int","`",")",":","The","number","of","new","position","embedding","matrix",".","If","position","embeddings","are","learned",",","increasing","the","size","will","add","newly","initialized","vectors","at","the","end",",","whereas","reducing","the","size","will","remove","vectors","from","the","end",".","If","position","embeddings","are","not","learned","(","*","e.g",".","*","sinusoidal","position","embeddings",")",",","increasing","the","size","will","add","correct","vectors","at","the","end","following","the","position","encoding","algorithm",",","whereas","reducing","the","size","will","remove","vectors","from","the","end","."]
code: def resize_position_embeddings(
      self, new_num_position_embeddings: int
  ):
      """
      Resizes position embeddings of the model if :obj:`new_num_position_embeddings !=
      config.max_position_embeddings`.
  
      Arguments:
          new_num_position_embeddings (:obj:`int`):
              The number of new position embedding matrix. If position embeddings are learned, increasing the size
              will add newly initialized vectors at the end, whereas reducing the size will remove vectors from the
              end. If position embeddings are not learned (*e.g.* sinusoidal position embeddings), increasing the
              size will add correct vectors at the end following the position encoding algorithm, whereas reducing
              the size will remove vectors from the end.
      """
      self.distilbert.resize_position_embeddings(
          new_num_position_embeddings
      )
  
imports: import torch.nn
  from transformers.models.distilbert.modeling_distilbert import DISTILBERT_INPUTS_DOCSTRING, DISTILBERT_START_DOCSTRING, DistilBertModel, DistilBertPreTrainedModel
  from transformers.utils import add_start_docstrings, add_start_docstrings_to_model_forward
  from ...heads import BertStyleMaskedLMHead, BiaffineParsingHead, CausalLMHead, ClassificationHead, ModelWithFlexibleHeadsAdaptersMixin, MultiLabelClassificationHead, MultipleChoiceHead, QuestionAnsweringHead, TaggingHead
  from ...model_mixin import EmbeddingAdaptersWrapperMixin
  from ...wrappers import init
label_desc: Use image node_id 3 for calling the DistilBertAdapterModel obj's underlying member method code with example usage: obj.resize_position_embeddings(new_num_position_embeddings) without return types