o
    )iU                     @  s8   d dl mZ d dlmZmZ dgZG dd dedZdS )    )annotations)ABCMetaabstractmethodBaseEncoderc                   @  sX   e Zd ZdZeedddZeedddZeedd
dZeedddZ	dS )r   a  
    Abstract class defines interface of encoders in flexible unet.
    Encoders in flexible unet must derive from this class. Each interface method
    should return a list containing relative information about a series of networks
    defined by encoder. For example, the efficient-net encoder implement 10 basic
    network structures in one encoder. When calling `get_encoder_name_string_list`
    function, a string list like ["efficientnet-b0", "efficientnet-b1" ... "efficientnet-l2"]
    should be returned.
    return
list[dict]c                 C     t )a  
        Get parameter list to initialize encoder networks.
        Each parameter dict must have `spatial_dims`, `in_channels`
        and `pretrained` parameters.
        The reason that this function should return a list is that a
        series of encoders can be implemented by one encoder class
        given different initialization parameters. Each parameter dict
        in return list should be able to initialize a unique encoder.
        NotImplementedErrorcls r   _/home/dell461/cl/sdc2/last_ska_mid/HISourceFinder-master-l/src/monai/networks/blocks/encoder.pyget_encoder_parameters      z"BaseEncoder.get_encoder_parameterslist[tuple[int, ...]]c                 C  r   )a  
        Get number of output features' channels.
        The reason that this function should return a list is that a
        series of encoders can be implemented by one encoder class
        given different initialization parameters. And it is possible
        that different encoders have different output feature map
        channels. Therefore a list of output feature map channel tuples
        corresponding to each encoder should be returned by this method.
        r	   r   r   r   r   num_channels_per_output,   r   z#BaseEncoder.num_channels_per_output	list[int]c                 C  r   )a  
        Get number of outputs of encoder.
        The reason that this function should return a list is that a
        series of encoders can be implemented by one encoder class
        given different initialization parameters. And it is possible
        that different encoders have different output feature numbers.
        Therefore a list of output feature numbers corresponding to
        each encoder should be returned by this method.
        r	   r   r   r   r   num_outputs:   r   zBaseEncoder.num_outputs	list[str]c                 C  r   )a  
        Get the name string of encoders which will be used to initialize
        flexible unet.
        The reason that this function should return a list is that a
        series of encoders can be implemented by one encoder class
        given different initialization parameters. And a name string is
        the key to each encoder in flexible unet backbone registry.
        Therefore this method should return every encoder name that needs
        to be registered in flexible unet.
        r	   r   r   r   r   get_encoder_namesH   s   zBaseEncoder.get_encoder_namesN)r   r   )r   r   )r   r   )r   r   )
__name__
__module____qualname____doc__classmethodr   r   r   r   r   r   r   r   r   r      s    
)	metaclassN)
__future__r   abcr   r   __all__r   r   r   r   r   <module>   s   