class_docstr: Position embedding with learnable embedding weights.
  
  Args:
      num_feats (int): The feature dimension for each position
          along x-axis or y-axis. The final returned dimension for
          each position is 2 times of this value.
      row_num_embed (int, optional): The dictionary size of row embeddings.
          Default 50.
      col_num_embed (int, optional): The dictionary size of col embeddings.
          Default 50.
      init_cfg (dict or list[dict], optional): Initialization config dict.
class_docstr_tok: ["Position","embedding","with","learnable","embedding","weights",".","Args",":","num_feats","(","int",")",":","The","feature","dimension","for","each","position","along","x-axis","or","y-axis",".","The","final","returned","dimension","for","each","position","is","2","times","of","this","value",".","row_num_embed","(","int",",","optional",")",":","The","dictionary","size","of","row","embeddings",".","Default","50.","col_num_embed","(","int",",","optional",")",":","The","dictionary","size","of","col","embeddings",".","Default","50.","init_cfg","(","dict","or","list","[","dict","]",",","optional",")",":","Initialization","config","dict","."]
code: def __init__(
      self,
      num_feats,
      row_num_embed=50,
      col_num_embed=50,
      init_cfg=dict(type="Uniform", layer="Embedding"),
  ):
      super(LearnedPositionalEncoding, self).__init__(init_cfg)
      self.row_embed = nn.Embedding(row_num_embed, num_feats)
      self.col_embed = nn.Embedding(col_num_embed, num_feats)
      self.num_feats = num_feats
      self.row_num_embed = row_num_embed
      self.col_num_embed = col_num_embed
  
file_path: dinov2/dinov2/eval/segmentation_m2f/models/utils/positional_encoding.py
imports: import math
  import torch
  import torch.nn
  from mmcv.cnn.bricks.transformer import POSITIONAL_ENCODING
  from mmcv.runner import BaseModule
label_desc: Use image node_id 1 to create a new LearnedPositionalEncoding object from inherited base classes: BaseModule with example: obj = LearnedPositionalEncoding(num_feats, row_num_embed, col_num_embed, init_cfg)