diff options
author | Jordan Gong <jordan.gong@protonmail.com> | 2021-01-07 19:55:00 +0800 |
---|---|---|
committer | Jordan Gong <jordan.gong@protonmail.com> | 2021-01-07 19:55:00 +0800 |
commit | 98b6e6dc3be6f88abb72e351c8f2da2b23b8ab85 (patch) | |
tree | 05f690b2411acae88ae81bb716703dcab4557842 /utils/sampler.py | |
parent | 4a284084c253b9114fc02e1782962556ff113761 (diff) |
Type hint for python version lower than 3.9
Diffstat (limited to 'utils/sampler.py')
-rw-r--r-- | utils/sampler.py | 4 |
1 files changed, 2 insertions, 2 deletions
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'] |