File tree 1 file changed +2
-2
lines changed
pytorch_lightning/trainer 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -2025,7 +2025,7 @@ def device_ids(self) -> List[int]:
2025
2025
@property
2026
2026
def num_devices (self ) -> int :
2027
2027
"""Number of devices the trainer uses per node."""
2028
- return len (self .strategy . parallel_devices ) if isinstance ( self . strategy , ParallelStrategy ) else 1
2028
+ return len (self .device_ids )
2029
2029
2030
2030
@property
2031
2031
def num_processes (self ) -> int :
@@ -2048,7 +2048,7 @@ def num_gpus(self) -> int:
2048
2048
return self ._accelerator_connector .num_gpus
2049
2049
2050
2050
@property
2051
- def devices (self ) -> Optional [ Union [ List [ int ], str , int ]] :
2051
+ def devices (self ) -> int :
2052
2052
rank_zero_deprecation (
2053
2053
"`Trainer.devices` was deprecated in v1.6 and will be removed in v1.8."
2054
2054
" Please use `Trainer.num_devices` or `Trainer.device_ids` to get device information instead."
You can’t perform that action at this time.
0 commit comments