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:
1187
1187
return getattr (self .strategy , "num_nodes" , 1 )
1188
1188
1189
1189
@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."""
1192
1192
devices = (
1193
1193
self .strategy .parallel_devices
1194
1194
if isinstance (self .strategy , ParallelStrategy )
1195
1195
else [self .strategy .root_device ]
1196
1196
)
1197
1197
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."""
1203
1198
device_ids = []
1204
- for idx , device in enumerate (self . devices ):
1199
+ for idx , device in enumerate (devices ):
1205
1200
if isinstance (device , torch .device ):
1206
1201
device_ids .append (device .index or idx )
1207
1202
elif isinstance (device , int ):
You can’t perform that action at this time.
0 commit comments