Initialize `module.weight` using the "MSRAFill" implemented in Caffe2. Also initializes `module.bias` to 0. Args: module (torch.nn.Module): module to initialize.
(module: nn.Module)
| 115 | |
| 116 | |
| 117 | def c2_msra_fill(module: nn.Module) -> None: |
| 118 | """ |
| 119 | Initialize `module.weight` using the "MSRAFill" implemented in Caffe2. |
| 120 | Also initializes `module.bias` to 0. |
| 121 | |
| 122 | Args: |
| 123 | module (torch.nn.Module): module to initialize. |
| 124 | """ |
| 125 | nn.init.kaiming_normal_(module.weight, mode="fan_out", nonlinearity="relu") |
| 126 | if module.bias is not None: |
| 127 | # pyre-fixme[6]: Expected `Tensor` for 1st param but got `Union[nn.Module, |
| 128 | # torch.Tensor]`. |
| 129 | nn.init.constant_(module.bias, 0) |
| 130 | |
| 131 | |
| 132 | def cat(tensors: List[torch.Tensor], dim: int = 0): |
nothing calls this directly
no outgoing calls
no test coverage detected