Ah I see, thanks for the clarification! The else condition will be triggered when you pass a list of multiple ranks as the device_ids arg to the DDP constructor. This basically allows you to specify which CUDA devices model replicas will be placed on (docs here).