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","."]
docstr: `input.shape` is expected to be [bsz x seqlen].
code: def forward(self, input, step: int = 0):
      """`input.shape` is expected to be [bsz x seqlen]."""
      bsz, seq_len = input.size(0), input.size(1)
      positions = self.make_positions(input, step)
      mask = (
          torch.ne(input, self.padding_id)
          .unsqueeze(2)
          .expand(bsz, seq_len, self.embedding_dim)
      )
      return super().forward(positions) * mask
  
imports: import math
  import uuid
  from typing import Dict, Optional, List
  import torch
  from torch import Tensor, nn
  from torch.nn import Parameter, LayerNorm, Dropout
  from lightseq.training.ops.pytorch import util
  from lightseq.training.ops.pytorch.layer_base import TransformerEmbeddingLayerBase, TransformerEncoderLayerBase, TransformerDecoderLayerBase
  from .quantization import QuantLinear, TensorQuantizer, act_quant_config, weight_quant_config, out_quant_config, emb_quant_config
label_desc: Use image node_id 3 for calling the TrainablePositionalEmbedding obj's underlying member method code with example usage: obj.forward(input, step) and returns: unknown