We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[BUG] Noise and Blur enhanced fail for certain images
### Describe the bug
The variable blur and noise augmentations [[ref](https://github.com/mlcommons/GaNDLF/blob/master/GANDLF/data/augmentation/blur_enhanced.py),[ref](https://github.com/mlcommons/GaNDLF/blob/master/GANDLF/data/augmentation/noise_enhanced.py)] fail for certain images that do not have a float pixel type.

### To Reproduce
Steps to reproduce the behavior:
1. Use png data for training.
2. Use either of one of these 2 augmentations.
3. See error.

### Expected behavior
It should run. A simple fix is to add `image.data.float()` before calling `torch.std` for both.

### Media
N.A.

### Environment information
<!-- Put the output of the following command:
python ./gandlf_debugInfo
-->
N.A.

### Additional context
N.A.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `GANDLF/data/augmentation/blur_enhanced.py`
Content:
```
1 # adapted from https://github.com/fepegar/torchio/blob/main/src/torchio/transforms/augmentation/intensity/random_blur.py
2 
3 from collections import defaultdict
4 from typing import Union, Tuple
5 
6 import torch
7 
8 from torchio.typing import TypeTripletFloat, TypeSextetFloat
9 from torchio.data.subject import Subject
10 from torchio.transforms import IntensityTransform
11 from torchio.transforms.augmentation import RandomTransform
12 from torchio.transforms.augmentation.intensity.random_blur import Blur
13 
14 
15 class RandomBlurEnhanced(RandomTransform, IntensityTransform):
16     r"""Blur an image using a random-sized Gaussian filter.
17 
18     Args:
19         std: Tuple :math:`(a_1, b_1, a_2, b_2, a_3, b_3)` representing the
20             ranges (in mm) of the standard deviations
21             :math:`(\sigma_1, \sigma_2, \sigma_3)` of the Gaussian kernels used
22             to blur the image along each axis, where
23             :math:`\sigma_i \sim \mathcal{U}(a_i, b_i)`.
24             If two values :math:`(a, b)` are provided,
25             then :math:`\sigma_i \sim \mathcal{U}(a, b)`.
26             If only one value :math:`x` is provided,
27             then :math:`\sigma_i \sim \mathcal{U}(0, x)`.
28             If three values :math:`(x_1, x_2, x_3)` are provided,
29             then :math:`\sigma_i \sim \mathcal{U}(0, x_i)`.
30         **kwargs: See :class:`~torchio.transforms.Transform` for additional
31             keyword arguments.
32     """
33 
34     def __init__(self, std: Union[float, Tuple[float, float]] = None, **kwargs):
35         super().__init__(**kwargs)
36         self.std_original = std
37 
38     def apply_transform(self, subject: Subject) -> Subject:
39         arguments = defaultdict(dict)
40         for name, image in self.get_images_dict(subject).items():
41             self.std_ranges = self.calculate_std_ranges(image)
42             arguments["std"][name] = self.get_params(self.std_ranges)
43         transform = Blur(**self.add_include_exclude(arguments))
44         transformed = transform(subject)
45         return transformed
46 
47     def get_params(self, std_ranges: TypeSextetFloat) -> TypeTripletFloat:
48         std = self.sample_uniform_sextet(std_ranges)
49         return std
50 
51     def calculate_std_ranges(self, image: torch.Tensor) -> Tuple[float, float]:
52         std_ranges = self.std_original
53         if self.std_original is None:
54             # calculate the default std range based on 1.5% of the input image std - https://github.com/mlcommons/GaNDLF/issues/518
55             std_ranges = (0, 0.015 * torch.std(image.data).item())
56         return self.parse_params(std_ranges, None, "std", min_constraint=0)
57
```

Path: `GANDLF/data/augmentation/noise_enhanced.py`
Content:
```
1 # adapted from https://github.com/fepegar/torchio/blob/main/src/torchio/transforms/augmentation/intensity/random_noise.py
2 
3 from collections import defaultdict
4 from typing import Tuple, Union
5 
6 import torch
7 from torchio.data.subject import Subject
8 from torchio.transforms import IntensityTransform
9 from torchio.transforms.augmentation import RandomTransform
10 from torchio.transforms.augmentation.intensity.random_noise import Noise
11 
12 
13 class RandomNoiseEnhanced(RandomTransform, IntensityTransform):
14     r"""Add Gaussian noise with random parameters.
15 
16     Add noise sampled from a normal distribution with random parameters.
17 
18     Args:
19         mean: Mean :math:`\mu` of the Gaussian distribution
20             from which the noise is sampled.
21             If two values :math:`(a, b)` are provided,
22             then :math:`\mu \sim \mathcal{U}(a, b)`.
23             If only one value :math:`d` is provided,
24             :math:`\mu \sim \mathcal{U}(-d, d)`.
25         std: Standard deviation :math:`\sigma` of the Gaussian distribution
26             from which the noise is sampled.
27             If two values :math:`(a, b)` are provided,
28             then :math:`\sigma \sim \mathcal{U}(a, b)`.
29             If only one value :math:`d` is provided,
30             :math:`\sigma \sim \mathcal{U}(0, d)`.
31         **kwargs: See :class:`~torchio.transforms.Transform` for additional
32             keyword arguments.
33     """
34 
35     def __init__(
36         self,
37         mean: Union[float, Tuple[float, float]] = 0,
38         std: Union[float, Tuple[float, float]] = (0, 0.25),
39         **kwargs
40     ):
41         super().__init__(**kwargs)
42         self.mean_range = self._parse_range(mean, "mean")
43         self.std_original = std
44 
45     def apply_transform(self, subject: Subject) -> Subject:
46         arguments = defaultdict(dict)
47         for name, image in self.get_images_dict(subject).items():
48             self.std_range = self.calculate_std_ranges(image)
49             mean, std, seed = self.get_params(self.mean_range, self.std_range)
50             arguments["mean"][name] = mean
51             arguments["std"][name] = std
52             arguments["seed"][name] = seed
53         transform = Noise(**self.add_include_exclude(arguments))
54         transformed = transform(subject)
55         return transformed
56 
57     def get_params(
58         self, mean_range: Tuple[float, float], std_range: Tuple[float, float]
59     ) -> Tuple[float, float]:
60         mean = self.sample_uniform(*mean_range)
61         std = self.sample_uniform(*std_range)
62         seed = self._get_random_seed()
63         return mean, std, seed
64 
65     def calculate_std_ranges(self, image: torch.Tensor) -> Tuple[float, float]:
66         std_ranges = self.std_original
67         if self.std_original is None:
68             # calculate the default std range based on 1.5% of the input image std - https://github.com/mlcommons/GaNDLF/issues/518
69             std_ranges = (0, 0.015 * torch.std(image.data).item())
70         return self._parse_range(std_ranges, "std", min_constraint=0)
71
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/GANDLF/data/augmentation/blur_enhanced.py b/GANDLF/data/augmentation/blur_enhanced.py
--- a/GANDLF/data/augmentation/blur_enhanced.py
+++ b/GANDLF/data/augmentation/blur_enhanced.py
@@ -52,5 +52,5 @@
         std_ranges = self.std_original
         if self.std_original is None:
             # calculate the default std range based on 1.5% of the input image std - https://github.com/mlcommons/GaNDLF/issues/518
-            std_ranges = (0, 0.015 * torch.std(image.data).item())
+            std_ranges = (0, 0.015 * torch.std(image.data.float()).item())
         return self.parse_params(std_ranges, None, "std", min_constraint=0)
diff --git a/GANDLF/data/augmentation/noise_enhanced.py b/GANDLF/data/augmentation/noise_enhanced.py
--- a/GANDLF/data/augmentation/noise_enhanced.py
+++ b/GANDLF/data/augmentation/noise_enhanced.py
@@ -66,5 +66,5 @@
         std_ranges = self.std_original
         if self.std_original is None:
             # calculate the default std range based on 1.5% of the input image std - https://github.com/mlcommons/GaNDLF/issues/518
-            std_ranges = (0, 0.015 * torch.std(image.data).item())
+            std_ranges = (0, 0.015 * torch.std(image.data.float()).item())
         return self._parse_range(std_ranges, "std", min_constraint=0)

{"golden_diff": "diff --git a/GANDLF/data/augmentation/blur_enhanced.py b/GANDLF/data/augmentation/blur_enhanced.py\n--- a/GANDLF/data/augmentation/blur_enhanced.py\n+++ b/GANDLF/data/augmentation/blur_enhanced.py\n@@ -52,5 +52,5 @@\n         std_ranges = self.std_original\n         if self.std_original is None:\n             # calculate the default std range based on 1.5% of the input image std - https://github.com/mlcommons/GaNDLF/issues/518\n-            std_ranges = (0, 0.015 * torch.std(image.data).item())\n+            std_ranges = (0, 0.015 * torch.std(image.data.float()).item())\n         return self.parse_params(std_ranges, None, \"std\", min_constraint=0)\ndiff --git a/GANDLF/data/augmentation/noise_enhanced.py b/GANDLF/data/augmentation/noise_enhanced.py\n--- a/GANDLF/data/augmentation/noise_enhanced.py\n+++ b/GANDLF/data/augmentation/noise_enhanced.py\n@@ -66,5 +66,5 @@\n         std_ranges = self.std_original\n         if self.std_original is None:\n             # calculate the default std range based on 1.5% of the input image std - https://github.com/mlcommons/GaNDLF/issues/518\n-            std_ranges = (0, 0.015 * torch.std(image.data).item())\n+            std_ranges = (0, 0.015 * torch.std(image.data.float()).item())\n         return self._parse_range(std_ranges, \"std\", min_constraint=0)\n", "issue": "[BUG] Noise and Blur enhanced fail for certain images\n### Describe the bug\r\nThe variable blur and noise augmentations [[ref](https://github.com/mlcommons/GaNDLF/blob/master/GANDLF/data/augmentation/blur_enhanced.py),[ref](https://github.com/mlcommons/GaNDLF/blob/master/GANDLF/data/augmentation/noise_enhanced.py)] fail for certain images that do not have a float pixel type.\r\n\r\n### To Reproduce\r\nSteps to reproduce the behavior:\r\n1. Use png data for training.\r\n2. Use either of one of these 2 augmentations.\r\n3. See error.\r\n\r\n### Expected behavior\r\nIt should run. A simple fix is to add `image.data.float()` before calling `torch.std` for both.\r\n\r\n### Media\r\nN.A.\r\n\r\n### Environment information\r\n<!-- Put the output of the following command:\r\npython ./gandlf_debugInfo\r\n-->\r\nN.A.\r\n\r\n### Additional context\r\nN.A.\r\n\n", "before_files": [{"content": "# adapted from https://github.com/fepegar/torchio/blob/main/src/torchio/transforms/augmentation/intensity/random_blur.py\n\nfrom collections import defaultdict\nfrom typing import Union, Tuple\n\nimport torch\n\nfrom torchio.typing import TypeTripletFloat, TypeSextetFloat\nfrom torchio.data.subject import Subject\nfrom torchio.transforms import IntensityTransform\nfrom torchio.transforms.augmentation import RandomTransform\nfrom torchio.transforms.augmentation.intensity.random_blur import Blur\n\n\nclass RandomBlurEnhanced(RandomTransform, IntensityTransform):\n    r\"\"\"Blur an image using a random-sized Gaussian filter.\n\n    Args:\n        std: Tuple :math:`(a_1, b_1, a_2, b_2, a_3, b_3)` representing the\n            ranges (in mm) of the standard deviations\n            :math:`(\\sigma_1, \\sigma_2, \\sigma_3)` of the Gaussian kernels used\n            to blur the image along each axis, where\n            :math:`\\sigma_i \\sim \\mathcal{U}(a_i, b_i)`.\n            If two values :math:`(a, b)` are provided,\n            then :math:`\\sigma_i \\sim \\mathcal{U}(a, b)`.\n            If only one value :math:`x` is provided,\n            then :math:`\\sigma_i \\sim \\mathcal{U}(0, x)`.\n            If three values :math:`(x_1, x_2, x_3)` are provided,\n            then :math:`\\sigma_i \\sim \\mathcal{U}(0, x_i)`.\n        **kwargs: See :class:`~torchio.transforms.Transform` for additional\n            keyword arguments.\n    \"\"\"\n\n    def __init__(self, std: Union[float, Tuple[float, float]] = None, **kwargs):\n        super().__init__(**kwargs)\n        self.std_original = std\n\n    def apply_transform(self, subject: Subject) -> Subject:\n        arguments = defaultdict(dict)\n        for name, image in self.get_images_dict(subject).items():\n            self.std_ranges = self.calculate_std_ranges(image)\n            arguments[\"std\"][name] = self.get_params(self.std_ranges)\n        transform = Blur(**self.add_include_exclude(arguments))\n        transformed = transform(subject)\n        return transformed\n\n    def get_params(self, std_ranges: TypeSextetFloat) -> TypeTripletFloat:\n        std = self.sample_uniform_sextet(std_ranges)\n        return std\n\n    def calculate_std_ranges(self, image: torch.Tensor) -> Tuple[float, float]:\n        std_ranges = self.std_original\n        if self.std_original is None:\n            # calculate the default std range based on 1.5% of the input image std - https://github.com/mlcommons/GaNDLF/issues/518\n            std_ranges = (0, 0.015 * torch.std(image.data).item())\n        return self.parse_params(std_ranges, None, \"std\", min_constraint=0)\n", "path": "GANDLF/data/augmentation/blur_enhanced.py"}, {"content": "# adapted from https://github.com/fepegar/torchio/blob/main/src/torchio/transforms/augmentation/intensity/random_noise.py\n\nfrom collections import defaultdict\nfrom typing import Tuple, Union\n\nimport torch\nfrom torchio.data.subject import Subject\nfrom torchio.transforms import IntensityTransform\nfrom torchio.transforms.augmentation import RandomTransform\nfrom torchio.transforms.augmentation.intensity.random_noise import Noise\n\n\nclass RandomNoiseEnhanced(RandomTransform, IntensityTransform):\n    r\"\"\"Add Gaussian noise with random parameters.\n\n    Add noise sampled from a normal distribution with random parameters.\n\n    Args:\n        mean: Mean :math:`\\mu` of the Gaussian distribution\n            from which the noise is sampled.\n            If two values :math:`(a, b)` are provided,\n            then :math:`\\mu \\sim \\mathcal{U}(a, b)`.\n            If only one value :math:`d` is provided,\n            :math:`\\mu \\sim \\mathcal{U}(-d, d)`.\n        std: Standard deviation :math:`\\sigma` of the Gaussian distribution\n            from which the noise is sampled.\n            If two values :math:`(a, b)` are provided,\n            then :math:`\\sigma \\sim \\mathcal{U}(a, b)`.\n            If only one value :math:`d` is provided,\n            :math:`\\sigma \\sim \\mathcal{U}(0, d)`.\n        **kwargs: See :class:`~torchio.transforms.Transform` for additional\n            keyword arguments.\n    \"\"\"\n\n    def __init__(\n        self,\n        mean: Union[float, Tuple[float, float]] = 0,\n        std: Union[float, Tuple[float, float]] = (0, 0.25),\n        **kwargs\n    ):\n        super().__init__(**kwargs)\n        self.mean_range = self._parse_range(mean, \"mean\")\n        self.std_original = std\n\n    def apply_transform(self, subject: Subject) -> Subject:\n        arguments = defaultdict(dict)\n        for name, image in self.get_images_dict(subject).items():\n            self.std_range = self.calculate_std_ranges(image)\n            mean, std, seed = self.get_params(self.mean_range, self.std_range)\n            arguments[\"mean\"][name] = mean\n            arguments[\"std\"][name] = std\n            arguments[\"seed\"][name] = seed\n        transform = Noise(**self.add_include_exclude(arguments))\n        transformed = transform(subject)\n        return transformed\n\n    def get_params(\n        self, mean_range: Tuple[float, float], std_range: Tuple[float, float]\n    ) -> Tuple[float, float]:\n        mean = self.sample_uniform(*mean_range)\n        std = self.sample_uniform(*std_range)\n        seed = self._get_random_seed()\n        return mean, std, seed\n\n    def calculate_std_ranges(self, image: torch.Tensor) -> Tuple[float, float]:\n        std_ranges = self.std_original\n        if self.std_original is None:\n            # calculate the default std range based on 1.5% of the input image std - https://github.com/mlcommons/GaNDLF/issues/518\n            std_ranges = (0, 0.015 * torch.std(image.data).item())\n        return self._parse_range(std_ranges, \"std\", min_constraint=0)\n", "path": "GANDLF/data/augmentation/noise_enhanced.py"}], "after_files": [{"content": "# adapted from https://github.com/fepegar/torchio/blob/main/src/torchio/transforms/augmentation/intensity/random_blur.py\n\nfrom collections import defaultdict\nfrom typing import Union, Tuple\n\nimport torch\n\nfrom torchio.typing import TypeTripletFloat, TypeSextetFloat\nfrom torchio.data.subject import Subject\nfrom torchio.transforms import IntensityTransform\nfrom torchio.transforms.augmentation import RandomTransform\nfrom torchio.transforms.augmentation.intensity.random_blur import Blur\n\n\nclass RandomBlurEnhanced(RandomTransform, IntensityTransform):\n    r\"\"\"Blur an image using a random-sized Gaussian filter.\n\n    Args:\n        std: Tuple :math:`(a_1, b_1, a_2, b_2, a_3, b_3)` representing the\n            ranges (in mm) of the standard deviations\n            :math:`(\\sigma_1, \\sigma_2, \\sigma_3)` of the Gaussian kernels used\n            to blur the image along each axis, where\n            :math:`\\sigma_i \\sim \\mathcal{U}(a_i, b_i)`.\n            If two values :math:`(a, b)` are provided,\n            then :math:`\\sigma_i \\sim \\mathcal{U}(a, b)`.\n            If only one value :math:`x` is provided,\n            then :math:`\\sigma_i \\sim \\mathcal{U}(0, x)`.\n            If three values :math:`(x_1, x_2, x_3)` are provided,\n            then :math:`\\sigma_i \\sim \\mathcal{U}(0, x_i)`.\n        **kwargs: See :class:`~torchio.transforms.Transform` for additional\n            keyword arguments.\n    \"\"\"\n\n    def __init__(self, std: Union[float, Tuple[float, float]] = None, **kwargs):\n        super().__init__(**kwargs)\n        self.std_original = std\n\n    def apply_transform(self, subject: Subject) -> Subject:\n        arguments = defaultdict(dict)\n        for name, image in self.get_images_dict(subject).items():\n            self.std_ranges = self.calculate_std_ranges(image)\n            arguments[\"std\"][name] = self.get_params(self.std_ranges)\n        transform = Blur(**self.add_include_exclude(arguments))\n        transformed = transform(subject)\n        return transformed\n\n    def get_params(self, std_ranges: TypeSextetFloat) -> TypeTripletFloat:\n        std = self.sample_uniform_sextet(std_ranges)\n        return std\n\n    def calculate_std_ranges(self, image: torch.Tensor) -> Tuple[float, float]:\n        std_ranges = self.std_original\n        if self.std_original is None:\n            # calculate the default std range based on 1.5% of the input image std - https://github.com/mlcommons/GaNDLF/issues/518\n            std_ranges = (0, 0.015 * torch.std(image.data.float()).item())\n        return self.parse_params(std_ranges, None, \"std\", min_constraint=0)\n", "path": "GANDLF/data/augmentation/blur_enhanced.py"}, {"content": "# adapted from https://github.com/fepegar/torchio/blob/main/src/torchio/transforms/augmentation/intensity/random_noise.py\n\nfrom collections import defaultdict\nfrom typing import Tuple, Union\n\nimport torch\nfrom torchio.data.subject import Subject\nfrom torchio.transforms import IntensityTransform\nfrom torchio.transforms.augmentation import RandomTransform\nfrom torchio.transforms.augmentation.intensity.random_noise import Noise\n\n\nclass RandomNoiseEnhanced(RandomTransform, IntensityTransform):\n    r\"\"\"Add Gaussian noise with random parameters.\n\n    Add noise sampled from a normal distribution with random parameters.\n\n    Args:\n        mean: Mean :math:`\\mu` of the Gaussian distribution\n            from which the noise is sampled.\n            If two values :math:`(a, b)` are provided,\n            then :math:`\\mu \\sim \\mathcal{U}(a, b)`.\n            If only one value :math:`d` is provided,\n            :math:`\\mu \\sim \\mathcal{U}(-d, d)`.\n        std: Standard deviation :math:`\\sigma` of the Gaussian distribution\n            from which the noise is sampled.\n            If two values :math:`(a, b)` are provided,\n            then :math:`\\sigma \\sim \\mathcal{U}(a, b)`.\n            If only one value :math:`d` is provided,\n            :math:`\\sigma \\sim \\mathcal{U}(0, d)`.\n        **kwargs: See :class:`~torchio.transforms.Transform` for additional\n            keyword arguments.\n    \"\"\"\n\n    def __init__(\n        self,\n        mean: Union[float, Tuple[float, float]] = 0,\n        std: Union[float, Tuple[float, float]] = (0, 0.25),\n        **kwargs\n    ):\n        super().__init__(**kwargs)\n        self.mean_range = self._parse_range(mean, \"mean\")\n        self.std_original = std\n\n    def apply_transform(self, subject: Subject) -> Subject:\n        arguments = defaultdict(dict)\n        for name, image in self.get_images_dict(subject).items():\n            self.std_range = self.calculate_std_ranges(image)\n            mean, std, seed = self.get_params(self.mean_range, self.std_range)\n            arguments[\"mean\"][name] = mean\n            arguments[\"std\"][name] = std\n            arguments[\"seed\"][name] = seed\n        transform = Noise(**self.add_include_exclude(arguments))\n        transformed = transform(subject)\n        return transformed\n\n    def get_params(\n        self, mean_range: Tuple[float, float], std_range: Tuple[float, float]\n    ) -> Tuple[float, float]:\n        mean = self.sample_uniform(*mean_range)\n        std = self.sample_uniform(*std_range)\n        seed = self._get_random_seed()\n        return mean, std, seed\n\n    def calculate_std_ranges(self, image: torch.Tensor) -> Tuple[float, float]:\n        std_ranges = self.std_original\n        if self.std_original is None:\n            # calculate the default std range based on 1.5% of the input image std - https://github.com/mlcommons/GaNDLF/issues/518\n            std_ranges = (0, 0.015 * torch.std(image.data.float()).item())\n        return self._parse_range(std_ranges, \"std\", min_constraint=0)\n", "path": "GANDLF/data/augmentation/noise_enhanced.py"}]}