From 14acc858928a6b66ba993797f97928a1a669121c Mon Sep 17 00:00:00 2001 From: Ashwin Nair Date: Tue, 9 Jan 2024 16:20:45 +0400 Subject: [PATCH] mypy fix --- torchgeo/datasets/vhr10.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/torchgeo/datasets/vhr10.py b/torchgeo/datasets/vhr10.py index 9c3e701c9b7..43756df71a5 100644 --- a/torchgeo/datasets/vhr10.py +++ b/torchgeo/datasets/vhr10.py @@ -289,7 +289,8 @@ def _load_image(self, id_: int) -> Tensor: ) with Image.open(filename) as img: array: "np.typing.NDArray[np.int_]" = np.array(img) - tensor = torch.from_numpy(array).float() + tensor = torch.from_numpy(array) + tensor = tensor.float() # Convert from HxWxC to CxHxW tensor = tensor.permute((2, 0, 1)) return tensor