NonLocal2d¶ class mmcv.cnn.NonLocal2d(in_channels: int, sub_sample: bool = False, conv_cfg: Dict = {'type': 'Conv2d'}, **kwargs)[source]¶ 2D Non-local module. Parameters in_channels (int) – Same as NonLocalND. sub_sample (bool) – Whether to apply max pooling after pairwise function (Note that the sub_sample is applied on spatial only). Default: False. conv_cfg (None | dict) – Same as NonLocalND. Default: dict(type=’Conv2d’).