docstr: Embeds point prompts.
docstr_tok: ["Embeds","point","prompts","."]
code: def _embed_points(
      self, points: paddle.Tensor, labels: paddle.Tensor, pad: bool
  ) -> paddle.Tensor:
      """Embeds point prompts."""
      points = points + 0.5
      points = points.cast("float32")
      if pad:
          padding_point = paddle.zeros(shape=(points.shape[0], 1, 2))
          padding_label = -paddle.ones(shape=(labels.shape[0], 1))
          points = paddle.concat(x=[points, padding_point], axis=1)
          labels = paddle.concat(
              x=[labels.astype("float32"), padding_label], axis=1
          )
      point_embedding = self.pe_layer.forward_with_coords(
          points, self.input_image_size
      )
  
      point_embedding[labels == -1] = 0.0
      if point_embedding[labels == -1].shape[0] != 0:
          point_embedding[labels == -1] += self.not_a_point_embed.weight
      if point_embedding[labels == 0].shape[0] != 0:
          point_embedding[labels == 0] += self.point_embeddings[
              0
          ].weight
      if point_embedding[labels == 1].shape[0] != 0:
          point_embedding[labels == 1] += self.point_embeddings[
              1
          ].weight
      return point_embedding
  
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 3 for calling the PromptEncoder obj's underlying member method code with example usage: obj._embed_points(points, labels, pad) and returns: point_embedding