Skip to content

Commit d2259b9

Browse files
committed
dict_product function to accept Iterable[Any] for improved flexibility
Signed-off-by: R. Garcia-Dias <[email protected]>
1 parent a9b0fc9 commit d2259b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
from itertools import product
3434
from pathlib import Path
3535
from subprocess import PIPE, Popen
36-
from typing import Callable
36+
from typing import Any, Callable, Iterable
3737
from urllib.error import ContentTooShortError, HTTPError
3838

3939
import numpy as np
@@ -864,7 +864,7 @@ def equal_state_dict(st_1, st_2):
864864
TEST_DEVICES.append([torch.device("cuda")])
865865

866866

867-
def dict_product(**items: dict[str, list]) -> list[dict]:
867+
def dict_product(**items: Iterable[Any]) -> list[dict]:
868868
"""Create cartesian product, equivalent to a nested for-loop, combinations of the items dict.
869869
870870
Args:

0 commit comments

Comments
 (0)