code: def _resize_final_logits_bias(self, new_num_tokens: int) -> None:
      old_num_tokens = self.final_logits_bias.shape[-1]
      if new_num_tokens <= old_num_tokens:
          new_bias = self.final_logits_bias[:, :new_num_tokens]
      else:
          extra_bias = torch.zeros(
              (1, new_num_tokens - old_num_tokens),
              device=self.final_logits_bias.device,
          )
          new_bias = torch.cat(
              [self.final_logits_bias, extra_bias], dim=1
          )
      self.register_buffer("final_logits_bias", new_bias)
  
imports: import copy
  from typing import List, Optional, Tuple, Union
  import torch
  import torch.nn
  from ...activations import ACT2FN
  from ...modeling_outputs import MoECausalLMOutputWithPast, MoEModelOutputWithPastAndCrossAttentions
  from ...modeling_utils import PreTrainedModel
  from ...utils import DUMMY_INPUTS, DUMMY_MASK, add_start_docstrings, add_start_docstrings_to_model_forward, is_torch_fx_proxy, logging
  from .configuration_gptsan_japanese import GPTSanJapaneseConfig
label_desc: Use image node_id 6 for calling the GPTSanJapaneseForConditionalGeneration obj's underlying member method code with example usage: obj._resize_final_logits_bias(new_num_tokens) without return types