summaryrefslogtreecommitdiff
path: root/utils/sampler.py
diff options
context:
space:
mode:
authorJordan Gong <jordan.gong@protonmail.com>2020-12-27 11:15:51 +0800
committerJordan Gong <jordan.gong@protonmail.com>2020-12-27 11:15:51 +0800
commit81b12f9357ca737599fbc11c732020666ad0873f (patch)
tree21beabf4ad44a0098478e143d8032bb42e5e92c0 /utils/sampler.py
parent31b20fbff0786c998c54b8585de759d02f41eda7 (diff)
Adopt type hinting generics in standard collections (PEP 585)
Diffstat (limited to 'utils/sampler.py')
-rw-r--r--utils/sampler.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/sampler.py b/utils/sampler.py
index 8dec846..0a177d1 100644
--- a/utils/sampler.py
+++ b/utils/sampler.py
@@ -1,5 +1,5 @@
import random
-from typing import Iterator, Tuple
+from collections.abc import Iterator
import numpy as np
from torch.utils import data
@@ -11,7 +11,7 @@ class TripletSampler(data.Sampler):
def __init__(
self,
data_source: CASIAB,
- batch_size: Tuple[int, int]
+ batch_size: tuple[int, int]
):
super().__init__(data_source)
self.metadata_labels = data_source.metadata['labels']