(nonlinear_activation, nonlinear_activation_params={})
| 57 | |
| 58 | |
| 59 | def get_activation(nonlinear_activation, nonlinear_activation_params={}): |
| 60 | if hasattr(nn, nonlinear_activation): |
| 61 | return getattr(nn, nonlinear_activation)(**nonlinear_activation_params) |
| 62 | else: |
| 63 | raise NotImplementedError(f"Activation {nonlinear_activation} not found in torch.nn") |
| 64 | |
| 65 | |
| 66 | def exists(v): |
nothing calls this directly
no outgoing calls
no test coverage detected