Convert the model into training mode while keep normalization layer freezed.
(self, mode=True)
| 415 | return dec_outs |
| 416 | |
| 417 | def train(self, mode=True): |
| 418 | """Convert the model into training mode while keep normalization layer |
| 419 | freezed.""" |
| 420 | super(UNet, self).train(mode) |
| 421 | if mode and self.norm_eval: |
| 422 | for m in self.modules(): |
| 423 | # trick: eval have effect on BatchNorm only |
| 424 | if isinstance(m, _BatchNorm): |
| 425 | m.eval() |
| 426 | |
| 427 | def _check_input_divisible(self, x): |
| 428 | h, w = x.shape[-2:] |
nothing calls this directly
no outgoing calls
no test coverage detected