class_docstr: Positional encoding using random spatial frequencies.
class_docstr_tok: ["Positional","encoding","using","random","spatial","frequencies","."]
docstr: Positionally encode points that are not normalized to [0,1].
docstr_tok: ["Positionally","encode","points","that","are","not","normalized","to","[","0,1","]","."]
code: def forward_with_coords(
      self, coords_input: paddle.Tensor, image_size: Tuple[int, int]
  ) -> paddle.Tensor:
      """Positionally encode points that are not normalized to [0,1]."""
      coords = coords_input.clone()
      coords[:, :, (0)] = coords[:, :, (0)] / image_size[1]
      coords[:, :, (1)] = coords[:, :, (1)] / image_size[0]
      """Class Method: *.to, not convert, please check whether it is torch.Tensor.*/Optimizer.*/nn.Module.*, and convert manually"""
      return self._pe_encoding(coords.astype("float32"))
  
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 4 for calling the PositionEmbeddingRandom obj's underlying member method code with example usage: obj.forward_with_coords(coords_input, image_size) and returns: self