File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
src/lightning/pytorch/trainer Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -1187,21 +1187,16 @@ def num_nodes(self) -> int:
11871187 return getattr (self .strategy , "num_nodes" , 1 )
11881188
11891189 @property
1190- def devices (self ) -> list [torch . device ]:
1191- """The devices the trainer uses per node."""
1190+ def device_ids (self ) -> list [int ]:
1191+ """List of device indexes per node."""
11921192 devices = (
11931193 self .strategy .parallel_devices
11941194 if isinstance (self .strategy , ParallelStrategy )
11951195 else [self .strategy .root_device ]
11961196 )
11971197 assert devices is not None
1198- return devices
1199-
1200- @property
1201- def device_ids (self ) -> list [int ]:
1202- """List of device indexes per node."""
12031198 device_ids = []
1204- for idx , device in enumerate (self . devices ):
1199+ for idx , device in enumerate (devices ):
12051200 if isinstance (device , torch .device ):
12061201 device_ids .append (device .index or idx )
12071202 elif isinstance (device , int ):
You can’t perform that action at this time.
0 commit comments