(act_layer)
| 2 | |
| 3 | |
| 4 | def build_act_layer(act_layer): |
| 5 | if act_layer == 'ReLU': |
| 6 | return nn.ReLU(inplace=True) |
| 7 | elif act_layer == 'SiLU': |
| 8 | return nn.SiLU(inplace=True) |
| 9 | elif act_layer == 'GELU': |
| 10 | return nn.GELU() |
| 11 | |
| 12 | raise NotImplementedError(f'build_act_layer does not support {act_layer}') |
| 13 | |
| 14 | |
| 15 | def build_norm_layer(dim, |