class_docstr: Generate a Prompt and concatenate it with the input.
  
  This is the training time version of prompting a model. Calling the injected `prompt` module will generate your
  unbatched prompt. This model then replicates it for the batched input and concatenates them together.
  
  Attributes:
      prompt: The module that actually generates the unbatched prompt.
      combine: A function that combines the prompt and the embedded input.
code: def _init_prompt_embedding(
      self, base_model_embeddings: nn.Module
  ) -> None:
      if self.prompt_tuning_config.prompt_init == "random_uniform":
          nn.init.uniform_(
              self.prompt_embedding.weight,
              a=-self.prompt_tuning_config.random_uniform_scale,
              b=self.prompt_tuning_config.random_uniform_scale,
          )
  
      elif self.prompt_tuning_config.prompt_init == "from_string":
          tokenizer = AutoTokenizer.from_pretrained(
              self.model_config.tokenizer_name_or_path
          )
          prompt_length = self.prompt_tuning_config.prompt_length
          prompt_text = self.prompt_tuning_config.prompt_init_text
          if prompt_text is None:
              raise ValueError(
                  "Prompt text must be provided when using prompt_init='from_string'."
              )
  
          tokenized_prompt_text: list[int] = tokenizer(prompt_text)["input_ids"]  # type: ignore
  
          # If the prompt text tokens are shorter than the prompt length, we repeat the prompt text tokens until we reach the prompt length
          if len(tokenized_prompt_text) < prompt_length:
              num_reps = math.ceil(
                  prompt_length / len(tokenized_prompt_text)
              )
              tokenized_prompt_text = tokenized_prompt_text * num_reps
  
          # Adjust length of prompt text tokens to match prompt_length
          tokenized_prompt_text = tokenized_prompt_text[:prompt_length]
  
          # Initialize prompt embedding with tokenized prompt text
          word_embedding_weights = (
              base_model_embeddings(
                  torch.LongTensor(tokenized_prompt_text)
              )
              .detach()
              .clone()
          )
          word_embedding_weights = word_embedding_weights.to(
              torch.float32
          )
          self.prompt_embedding.weight = nn.Parameter(
              word_embedding_weights
          )
  
      else:
          raise ValueError(
              f"Unknown prompt initialization: {self.prompt_tuning_config.prompt_init}"
          )
  
imports: import math
  from typing import Callable, Dict, List, Union
  import numpy
  import torch
  from torch import nn
  from transformers import AutoTokenizer
  from transformers.configuration_utils import PretrainedConfig
  from ..composition import AdapterCompositionBlock
  from ..configuration import ModelAdaptersConfig, PromptTuningConfig
  from ..context import ForwardContext
  from .adapter_layer_base import AdapterLayerBase
label_desc: Use image node_id 2 for calling the PromptTuning obj's underlying member method code with example usage: obj._init_prompt_embedding(base_model_embeddings) without return types