- class mmcv.ops.MaskedConv2d(in_channels: int, out_channels: int, kernel_size: Union[int, Tuple[int, ...]], stride: int = 1, padding: int = 0, dilation: int = 1, groups: int = 1, bias: bool = True)¶
A MaskedConv2d which inherits the official Conv2d.
The masked forward doesn’t implement the backward function and only supports the stride parameter to be 1 currently.
- forward(input: torch.Tensor, mask: Optional[torch.Tensor] = None) → torch.Tensor¶
Defines the computation performed at every call.
Should be overridden by all subclasses.
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.