class_docstr: This is a more standard version of the position embedding, very similar to the one
  used by the Attention is all you need paper, generalized to work on images.
class_docstr_tok: ["This","is","a","more","standard","version","of","the","position","embedding",",","very","similar","to","the","one","used","by","the","Attention","is","all","you","need","paper",",","generalized","to","work","on","images","."]
code: def __init__(
      self,
      num_pos_feats: int = 64,
      temperature: float = 10000,
      eps: float = 1e-06,
      normalize: bool = True,
      scale: bool = None,
  ):
      super().__init__()
      self.num_pos_feats = num_pos_feats
      self.temperature = temperature
      self.normalize = normalize
      self.eps = eps
      if scale is not None and normalize is False:
          raise ValueError(
              "normalize should be True if scale is passed"
          )
      if scale is None:
          scale = 2 * math.pi
      self.scale = scale
  
imports: import math
  from copy import deepcopy
  from dataclasses import dataclass
  from typing import Any, Tuple
  import torch
  from mmf.common.registry import registry
  from mmf.models.base_model import BaseModel
  from mmf.modules.encoders import IdentityEncoder
  from mmf.modules.layers import AttnPool1d
  from mmf.utils.build import build_classifier_layer, build_image_encoder, build_text_encoder
  from mmf.utils.general import filter_grads
  from mmf.utils.modeling import get_bert_configured_parameters
  from mmf.utils.transform import transform_to_batch_sequence
  from omegaconf import MISSING
label_desc: Use image node_id 1 to create a new PositionEmbeddingSine object from inherited base classes: torch.nn with example: obj = PositionEmbeddingSine(num_pos_feats, temperature, eps, normalize, scale)