Skip to content

Commit 13b74f7

Browse files
jedyang97Bordalantiga
authored
make plugin type check more flexible (#20186)
Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: Luca Antiga <[email protected]>
1 parent 87565cb commit 13b74f7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lightning/pytorch/trainer/connectors/accelerator_connector.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import logging
1616
import os
1717
from collections import Counter
18+
from collections.abc import Iterable
1819
from typing import Literal, Optional, Union
1920

2021
import torch
@@ -182,7 +183,7 @@ def _check_config_and_set_final_flags(
182183
183184
"""
184185
if plugins is not None:
185-
plugins = [plugins] if not isinstance(plugins, list) else plugins
186+
plugins = [plugins] if not isinstance(plugins, Iterable) else plugins
186187

187188
if isinstance(strategy, str):
188189
strategy = strategy.lower()

0 commit comments

Comments
 (0)