From c30ee91fb94436ff31da125a564632ddea9e3ed6 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Tue, 4 Oct 2022 07:30:45 +0000 Subject: [PATCH] Refactor the comparison involving `not` --- monai/networks/layers/weight_init.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monai/networks/layers/weight_init.py b/monai/networks/layers/weight_init.py index 9b81ef17f8..b0c6fae2c2 100644 --- a/monai/networks/layers/weight_init.py +++ b/monai/networks/layers/weight_init.py @@ -55,7 +55,7 @@ def trunc_normal_(tensor, mean=0.0, std=1.0, a=-2.0, b=2.0): b: the maximum cutoff value """ - if not std > 0: + if std <= 0: raise ValueError("the standard deviation should be greater than zero.") if a >= b: