src/transformers/models/mask2former/modeling_mask2former.py/Mask2FormerPixelDecoderEncoderMultiscaleDeformableAttention/with_pos_embed
class Mask2FormerPixelDecoderEncoderMultiscaleDeformableAttention:    def with_pos_embed(self, tensor: torch.Tensor, position_embeddings: Optional[Tensor]):
        return tensor if position_embeddings is None else tensor + position_embeddings