Skip to content

Commit 148586e

Browse files
authored
make plugin type check more flexible
1 parent 1551a16 commit 148586e

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 Dict, List, 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)