From 98b6e6dc3be6f88abb72e351c8f2da2b23b8ab85 Mon Sep 17 00:00:00 2001 From: Jordan Gong Date: Thu, 7 Jan 2021 19:55:00 +0800 Subject: Type hint for python version lower than 3.9 --- utils/sampler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'utils/sampler.py') diff --git a/utils/sampler.py b/utils/sampler.py index cdf1984..734acf9 100644 --- a/utils/sampler.py +++ b/utils/sampler.py @@ -1,6 +1,6 @@ import random from collections.abc import Iterator -from typing import Union +from typing import Union, Tuple import numpy as np from torch.utils import data @@ -12,7 +12,7 @@ class TripletSampler(data.Sampler): def __init__( self, data_source: Union[CASIAB], - batch_size: tuple[int, int] + batch_size: Tuple[int, int] ): super().__init__(data_source) self.metadata_labels = data_source.metadata['labels'] -- cgit v1.2.3 From e5a73abd80578aa5e46d8d444466d1e6346ec6ec Mon Sep 17 00:00:00 2001 From: Jordan Gong Date: Thu, 7 Jan 2021 19:55:00 +0800 Subject: Type hint for python version lower than 3.9 --- utils/sampler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils/sampler.py') diff --git a/utils/sampler.py b/utils/sampler.py index 734acf9..c1bf3dd 100644 --- a/utils/sampler.py +++ b/utils/sampler.py @@ -1,5 +1,5 @@ import random -from collections.abc import Iterator +from collections import Iterator from typing import Union, Tuple import numpy as np -- cgit v1.2.3 From 46e68c1d0168816107fd9997e1d948d3f403f5ee Mon Sep 17 00:00:00 2001 From: Jordan Gong Date: Thu, 7 Jan 2021 20:19:36 +0800 Subject: Type hint for python version lower than 3.9 --- utils/sampler.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'utils/sampler.py') diff --git a/utils/sampler.py b/utils/sampler.py index c1bf3dd..0977f94 100644 --- a/utils/sampler.py +++ b/utils/sampler.py @@ -1,6 +1,5 @@ import random -from collections import Iterator -from typing import Union, Tuple +from typing import Union, Tuple, Iterator import numpy as np from torch.utils import data -- cgit v1.2.3