(x)
| 880 | |
| 881 | @staticmethod |
| 882 | def _std(x): |
| 883 | if isinstance(x, np.ndarray): |
| 884 | return np.std(x) |
| 885 | x = torch.std(x.float(), unbiased=False) |
| 886 | return x.item() if x.numel() == 1 else x |
| 887 | |
| 888 | def _normalize(self, img: NdarrayOrTensor, sub=None, div=None) -> NdarrayOrTensor: |
| 889 | img, *_ = convert_data_type(img, dtype=torch.float32) |