From 81b12f9357ca737599fbc11c732020666ad0873f Mon Sep 17 00:00:00 2001 From: Jordan Gong Date: Sun, 27 Dec 2020 11:15:51 +0800 Subject: Adopt type hinting generics in standard collections (PEP 585) --- 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 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'] -- cgit v1.2.3