def _process_attention(attentions: ndarray, method: Literal['abs', 'pos']) -> List[ndarray]:
        """processes a N x grey-scale attention maps 

        Args:
            attentions (ndarray):
            method (str, optional):  Defaults to "abs".

        Raises:
            TypeError: _description_

        Returns:
            List[ndarray]: _description_
        """
        if method.startswith('abs'):
            return np.abs(attentions).mean(0)[np.newaxis, ...]

        elif method.startswith('pos'):
            attentions_copy = attentions[:]
            attentions_copy[attentions<0] = 0
            return attentions_copy

        else:
            raise TypeError(f"unknown method of {method}")
processes a N x grey-scale attention maps 

        Args:
            attentions (ndarray):
            method (str, optional):  Defaults to "abs".

        Raises:
            TypeError: _description_

        Returns:
            List[ndarray]: _description_
        
src/marqo/s2_inference/processing/image.py