Skip to content

Commit f9f11c6

Browse files
Alan ChuAlan Chu
authored andcommitted
remove List[int] as input types
1 parent 3627c5b commit f9f11c6

File tree

1 file changed

+3
-3
lines changed
  • src/lightning/fabric/accelerators

1 file changed

+3
-3
lines changed

src/lightning/fabric/accelerators/cpu.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ def teardown(self) -> None:
3939

4040
@staticmethod
4141
@override
42-
def parse_devices(devices: Union[int, str, List[int]]) -> int:
42+
def parse_devices(devices: Union[int, str]) -> int:
4343
"""Accelerator device parsing logic."""
4444
return _parse_cpu_cores(devices)
4545

4646
@staticmethod
4747
@override
48-
def get_parallel_devices(devices: Union[int, str, List[int]]) -> List[torch.device]:
48+
def get_parallel_devices(devices: Union[int, str]) -> List[torch.device]:
4949
"""Gets parallel devices for the Accelerator."""
5050
devices = _parse_cpu_cores(devices)
5151
return [torch.device("cpu")] * devices
@@ -72,7 +72,7 @@ def register_accelerators(cls, accelerator_registry: _AcceleratorRegistry) -> No
7272
)
7373

7474

75-
def _parse_cpu_cores(cpu_cores: Union[int, str, List[int]]) -> int:
75+
def _parse_cpu_cores(cpu_cores: Union[int, str]) -> int:
7676
"""Parses the cpu_cores given in the format as accepted by the ``devices`` argument in the
7777
:class:`~lightning.pytorch.trainer.trainer.Trainer`.
7878

0 commit comments

Comments
 (0)