mirror of
https://github.com/huggingface/pytorch-image-models.git
synced 2025-06-03 15:01:08 +08:00
Allow ntuple to be used with string values
This commit is contained in:
parent
7430a85d07
commit
8ad4bdfa06
@ -9,7 +9,7 @@ import collections.abc
|
|||||||
# From PyTorch internals
|
# From PyTorch internals
|
||||||
def _ntuple(n):
|
def _ntuple(n):
|
||||||
def parse(x):
|
def parse(x):
|
||||||
if isinstance(x, collections.abc.Iterable):
|
if isinstance(x, collections.abc.Iterable) and not isinstance(x, str):
|
||||||
return x
|
return x
|
||||||
return tuple(repeat(x, n))
|
return tuple(repeat(x, n))
|
||||||
return parse
|
return parse
|
||||||
|
Loading…
x
Reference in New Issue
Block a user