Build activation layer. Args: cfg (dict): The activation layer config, which should contain: - type (str): Layer type. - layer args: Args needed to instantiate an activation layer. Returns: nn.Module: Created activation layer.
(cfg)
| 149 | return name,layer |
| 150 | |
| 151 | def build_activation_layer(cfg): |
| 152 | """Build activation layer. |
| 153 | |
| 154 | Args: |
| 155 | cfg (dict): The activation layer config, which should contain: |
| 156 | |
| 157 | - type (str): Layer type. |
| 158 | - layer args: Args needed to instantiate an activation layer. |
| 159 | |
| 160 | Returns: |
| 161 | nn.Module: Created activation layer. |
| 162 | """ |
| 163 | cfg_ = copy.deepcopy(cfg) |
| 164 | return eval(cfg_.pop('type'))(**cfg_) |
| 165 | |
| 166 | def build_padding_layer(cfg, *args, **kwargs): |
| 167 | """Build padding layer. |
no outgoing calls
no test coverage detected