U Phm @sZddlmZddlmZddlZddlmZddlmZddl m Z Gdddej Z dS)) annotations)SequenceN)Pool)ensure_tuple_repcsBeZdZdZddddddd d fd d Zd d dddZZS) MaxAvgPoolz Downsample with both maxpooling and avgpooling, double the channel size by concatenating the downsampled feature maps. NrFintzSequence[int] | intzSequence[int] | int | NoneboolNone) spatial_dims kernel_sizestridepadding ceil_modereturncsftt|||dkrdnt||t|||d}ttj|ff||_ttj|ff||_dS)a Args: spatial_dims: number of spatial dimensions of the input image. kernel_size: the kernel size of both pooling operations. stride: the stride of the window. Default value is `kernel_size`. padding: implicit zero padding to be added to both pooling operations. ceil_mode: when True, will use ceil instead of floor to compute the output shape. N)r r r r)super__init__rrMAXmax_poolAVGavg_pool)selfr r r r r_params __class__U/home/dell461/cl/sdc2/HISourceFinder-master-l/src/monai/networks/blocks/downsample.pyrs zMaxAvgPool.__init__z torch.Tensor)xrcCstj||||gddS)z Args: x: Tensor in shape (batch, channel, spatial_1[, spatial_2, ...]). Returns: Tensor in shape (batch, 2*channel, spatial_1[, spatial_2, ...]). )dim)torchcatrr)rrrrrforward7szMaxAvgPool.forward)NrF)__name__ __module__ __qualname____doc__rr! __classcell__rrrrrs  r) __future__rcollections.abcrrtorch.nnnnmonai.networks.layers.factoriesr monai.utilsrModulerrrrr s