U
    Pha                     @  s`   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	d
ddZdS )    )annotations)CallableSizedN)InterpolateModedefault_upsamplerFr   boolz&Callable[[torch.Tensor], torch.Tensor])spatial_sizealign_cornersreturnc                   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    O/home/dell461/cl/sdc2/HISourceFinder-master-l/src/monai/visualize/visualizer.pyup   s    zdefault_upsampler.<locals>.upr   )r   r	   r   r   r   r   r      s    )F)
__future__r   collections.abcr   r   torchtorch.nn.functionalnn
functionalr   monai.utilsr   __all__r   r   r   r   r   <module>   s   