o
    ia                     @  sX   d dl mZ d dlmZmZ d dlZd dlm  mZ	 d dl
mZ dgZddddZdS )    )annotations)CallableSizedN)InterpolateModedefault_upsamplerFspatial_sizer   align_cornersboolreturn&Callable[[torch.Tensor], torch.Tensor]c                   s    fdd}|S )z
    A linear interpolation method for upsampling the feature map.
    The output of this function is a callable `func`,
    such that `func(x)` returns an upsampled tensor.
    c                   s8   t jt jt jg}|td  }tj| t|j dS )N   )sizemoder   )	r   LINEARBILINEAR	TRILINEARlenFinterpolatestrvalue)xlinear_modeinterp_moder   r    \/home/dell461/cl/sdc2/last_ska_mid/HISourceFinder-master-l/src/monai/visualize/visualizer.pyup   s   zdefault_upsampler.<locals>.upr   )r   r   r   r   r   r   r      s   )F)r   r   r   r	   r
   r   )
__future__r   collections.abcr   r   torchtorch.nn.functionalnn
functionalr   monai.utilsr   __all__r   r   r   r   r   <module>   s   