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