Skip to content

Commit 8ad4bdf

Browse files
committed
Allow ntuple to be used with string values
1 parent 7430a85 commit 8ad4bdf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

timm/models/layers/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# From PyTorch internals
1010
def _ntuple(n):
1111
def parse(x):
12-
if isinstance(x, collections.abc.Iterable):
12+
if isinstance(x, collections.abc.Iterable) and not isinstance(x, str):
1313
return x
1414
return tuple(repeat(x, n))
1515
return parse

0 commit comments

Comments
 (0)