class_docstr: Positional encoding using random spatial frequencies.
class_docstr_tok: ["Positional","encoding","using","random","spatial","frequencies","."]
code: def __init__(
      self, num_pos_feats: int = 64, scale: Optional[float] = None
  ) -> None:
      super().__init__()
      if scale is None or scale <= 0.0:
          scale = 1.0
      self.register_buffer(
          "positional_encoding_gaussian_matrix",
          scale * paddle.randn(shape=(2, num_pos_feats)),
      )
  
file_path: PaddleSeg/contrib/SegmentAnything/segment_anything/modeling/prompt_encoder.py
imports: import paddle
  import numpy
  from typing import Any, Optional, Tuple, Type
  from common import LayerNorm2d
label_desc: Use image node_id 1 to create a new PositionEmbeddingRandom object from inherited base classes: paddle.nn with example: obj = PositionEmbeddingRandom(num_pos_feats, scale)