⚡️ [Update] add activation function -> inplace
Browse files
yolo/tools/module_helper.py
CHANGED
|
@@ -31,7 +31,7 @@ def get_activation(activation: str) -> nn.Module:
|
|
| 31 |
if isinstance(obj, type) and issubclass(obj, nn.Module)
|
| 32 |
}
|
| 33 |
if activation.lower() in activation_map:
|
| 34 |
-
return activation_map[activation.lower()]()
|
| 35 |
else:
|
| 36 |
raise ValueError(f"Activation function '{activation}' is not found in torch.nn")
|
| 37 |
|
|
|
|
| 31 |
if isinstance(obj, type) and issubclass(obj, nn.Module)
|
| 32 |
}
|
| 33 |
if activation.lower() in activation_map:
|
| 34 |
+
return activation_map[activation.lower()](inplace=True)
|
| 35 |
else:
|
| 36 |
raise ValueError(f"Activation function '{activation}' is not found in torch.nn")
|
| 37 |
|