class_docstr: Learnable Positional embedding
code: def forward(self, seq_len: int, *args, **kwargs) -> Tensor:
      # scale pos embedding
      pos_embed = self.pos_embed
      if self.padding_idx is not None:
          with torch.no_grad():
              pos_embed[:, :, self.padding_idx, ...] = 0.0
  
      if seq_len != self.num_embeddings:
          pos_embed = F.interpolate(
              pos_embed,
              size=(seq_len, self.embedding_dim),
              mode=self.interpolation_mode,
          )
  
      # add dummy batch dimension
      if self.sequence_first:
          # Input is of the form [Seq_len, Batch, Embedding_dim]
          return pos_embed.reshape(seq_len, 1, self.embedding_dim)
      else:
          # Input is of the form [Batch, Seq_len, Embedding_dim]
          return pos_embed.reshape(1, seq_len, self.embedding_dim)
  
imports: import math
  from typing import Optional
  import torch
  from torch import Tensor, nn
  from torch.nn import functional
  from cvnets.layers import BaseLayer
label_desc: Use image node_id 3 for calling the LearnablePositionalEmbedding obj's underlying member method code with example usage: obj.forward(seq_len) and returns: pos_embed, pos_embed