def get_ddp_model(self):
        """
        Returns class:`~torch.nn.parallel.DistributedDataParallel`.
        Parallelizes the application of the given module.
        """
        if not self.model:
            print("Please input the model!")
            return None
        self.xpu_device = "xpu:{}".format(self.rank)
        torch.xpu.set_device(self.xpu_device)
        self.model.xpu(self.xpu_device)
        # note we set find_unused_parameters to True defaultly, to enable models (e.g. Bert) which have
        # parameters that don't receive gradients as part of this graph are preemptively marked as
        # being ready to be reduced. Note this may bring additional overhead.
        return torch.nn.parallel.DistributedDataParallel(
            self.model,
            device_ids=[self.xpu_device],
            output_device=self.xpu_device,
            find_unused_parameters=True,
        )

        Returns class:`~torch.nn.parallel.DistributedDataParallel`.
        Parallelizes the application of the given module.
        
intel_extension_for_pytorch/xpu/single_card.py