def __init__(self,
                 embed_dim: int,
                 image_embedding_size: Tuple[int, int],
                 input_image_size: Tuple[int, int],
                 mask_in_chans: int,
                 activation: Type[paddle.nn.Layer]=paddle.nn.GELU) -> None:
        """
        Encodes prompts for input to SAM's mask decoder.

        Arguments:
          embed_dim (int): The prompts' embedding dimension
          image_embedding_size (tuple(int, int)): The spatial size of the
            image embedding, as (H, W).
          input_image_size (int): The padded size of the image as input
            to the image encoder, as (H, W).
          mask_in_chans (int): The number of hidden channels used for
            encoding input masks.
          activation (nn.Module): The activation to use when encoding
            input masks.
        """
        super().__init__()
        self.embed_dim = embed_dim
        self.input_image_size = input_image_size
        self.image_embedding_size = image_embedding_size
        self.pe_layer = PositionEmbeddingRandom(embed_dim // 2)
        self.num_point_embeddings: int = 4
        point_embeddings = [
            paddle.nn.Embedding(1, embed_dim)
            for i in range(self.num_point_embeddings)
        ]
        self.point_embeddings = paddle.nn.LayerList(sublayers=point_embeddings)
        self.not_a_point_embed = paddle.nn.Embedding(1, embed_dim)
        self.mask_input_size = 4 * image_embedding_size[
            0], 4 * image_embedding_size[1]
        self.mask_downscaling = paddle.nn.Sequential(
            paddle.nn.Conv2D(
                in_channels=1,
                out_channels=mask_in_chans // 4,
                kernel_size=2,
                stride=2),
            LayerNorm2d(mask_in_chans // 4),
            activation(),
            paddle.nn.Conv2D(
                in_channels=mask_in_chans // 4,
                out_channels=mask_in_chans,
                kernel_size=2,
                stride=2),
            LayerNorm2d(mask_in_chans),
            activation(),
            paddle.nn.Conv2D(
                in_channels=mask_in_chans,
                out_channels=embed_dim,
                kernel_size=1))
        self.no_mask_embed = paddle.nn.Embedding(1, embed_dim)

        Encodes prompts for input to SAM's mask decoder.

        Arguments:
          embed_dim (int): The prompts' embedding dimension
          image_embedding_size (tuple(int, int)): The spatial size of the
            image embedding, as (H, W).
          input_image_size (int): The padded size of the image as input
            to the image encoder, as (H, W).
          mask_in_chans (int): The number of hidden channels used for
            encoding input masks.
          activation (nn.Module): The activation to use when encoding
            input masks.
        
contrib/SegmentAnything/segment_anything/modeling/prompt_encoder.py