class_docstr: This module learns positional embeddings up to a fixed maximum size.
class_docstr_tok: ["This","module","learns","positional","embeddings","up","to","a","fixed","maximum","size","."]
code: def __init__(self, weight_shape=None, weight=None, bias=None):
      # OPT is set up so that if padding_idx is specified then offset the embedding ids by 2
      # and adjust num_embeddings appropriately. Other models don't have this hack
      self.offset = 2
      super().__init__(weight_shape, weight=weight)
  
imports: import torch
  from deepspeed import comm
  from torch import nn
  from torch.nn import functional
  from torch.nn.parameter import Parameter
  from deepspeed.accelerator import get_accelerator
  from deepspeed.module_inject.tp_shard import get_shard_size, get_shard_size_list
label_desc: Use image node_id 1 to create a new OPTEmbedding object from inherited base classes: EmbeddingLayer with example: obj = OPTEmbedding(weight_shape, weight, bias)