Set `_choose_auto_accelerator` to `staticmethod` (#19822)
This commit is contained in:
parent
351bec7625
commit
19f0fb978c
|
@ -313,7 +313,8 @@ class _Connector:
|
|||
f" using {accelerator_name} accelerator."
|
||||
)
|
||||
|
||||
def _choose_auto_accelerator(self) -> str:
|
||||
@staticmethod
|
||||
def _choose_auto_accelerator() -> str:
|
||||
"""Choose the accelerator type (str) based on availability when ``accelerator='auto'``."""
|
||||
if XLAAccelerator.is_available():
|
||||
return "tpu"
|
||||
|
|
|
@ -328,7 +328,8 @@ class _AcceleratorConnector:
|
|||
f" using {accelerator_name} accelerator."
|
||||
)
|
||||
|
||||
def _choose_auto_accelerator(self) -> str:
|
||||
@staticmethod
|
||||
def _choose_auto_accelerator() -> str:
|
||||
"""Choose the accelerator type (str) based on availability."""
|
||||
if XLAAccelerator.is_available():
|
||||
return "tpu"
|
||||
|
|
Loading…
Reference in New Issue