class_docstr: Inference model implementation for ragged batching for OPT models.
class_docstr_tok: ["Inference","model","implementation","for","ragged","batching","for","OPT","models","."]
code: def _forward_embed(
      self, ragged_batch: RaggedBatchWrapper
  ) -> torch.Tensor:
      embed = self.embed(
          ragged_batch,
          self._non_transformer.word_emb,
          self._non_transformer.word_emb_pos,
      )
      if embed.shape[-1] != self.model_dim:
          raise ValueError(
              f"Embedding output shape {embed.shape} does not match model_dim {self.model_dim}"
          )
  
      return embed
  
imports: from typing import Iterable, Optional, Tuple
  import torch
  import deepspeed.comm
  from ...allocator import empty_from
  from ...inference_utils import ActivationType, DtypeEnum
  from ...model_implementations import *
  from ...modules.configs import *
  from ...ragged import RaggedBatchWrapper
  from .container import OPTNonTransformerContainer, OPTTransformerContainer
  from ...modules.heuristics import instantiate_embed
label_desc: Use image node_id 14 for calling the OPTInferenceModel obj's underlying member method code with example usage: obj._forward_embed(ragged_batch) and returns: embed