Skip to content

Commit 19f0fb9

Browse files
authored
Set _choose_auto_accelerator to staticmethod (#19822)
1 parent 351bec7 commit 19f0fb9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/lightning/fabric/connector.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ def _check_device_config_and_set_final_flags(self, devices: Union[List[int], str
313313
f" using {accelerator_name} accelerator."
314314
)
315315

316-
def _choose_auto_accelerator(self) -> str:
316+
@staticmethod
317+
def _choose_auto_accelerator() -> str:
317318
"""Choose the accelerator type (str) based on availability when ``accelerator='auto'``."""
318319
if XLAAccelerator.is_available():
319320
return "tpu"

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ def _check_device_config_and_set_final_flags(self, devices: Union[List[int], str
328328
f" using {accelerator_name} accelerator."
329329
)
330330

331-
def _choose_auto_accelerator(self) -> str:
331+
@staticmethod
332+
def _choose_auto_accelerator() -> str:
332333
"""Choose the accelerator type (str) based on availability."""
333334
if XLAAccelerator.is_available():
334335
return "tpu"

0 commit comments

Comments
 (0)