Make this block not trainable. This method sets all parameters to `requires_grad=False`, and convert all BatchNorm layers to FrozenBatchNorm Returns: the block itself
(self)
| 41 | self.stride = stride |
| 42 | |
| 43 | def freeze(self): |
| 44 | """ |
| 45 | Make this block not trainable. |
| 46 | This method sets all parameters to `requires_grad=False`, |
| 47 | and convert all BatchNorm layers to FrozenBatchNorm |
| 48 | |
| 49 | Returns: |
| 50 | the block itself |
| 51 | """ |
| 52 | for p in self.parameters(): |
| 53 | p.requires_grad = False |
| 54 | FrozenBatchNorm2d.convert_frozen_batchnorm(self) |
| 55 | return self |
| 56 | |
| 57 | |
| 58 | class DepthwiseSeparableConv2d(nn.Module): |
no test coverage detected