MaskedConv2d¶
- 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)[source]¶
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[source]¶
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.