self.device does not return the correct device in DataParallel
🐛 Bug
The self.device property does not get updated in the replicas of DataParallel.
Please reproduce using the BoringModel
### To Reproduce

import os

import torch
from torch.utils.data import Dataset

from pytorch_lightning import LightningModule, Trainer


class RandomDataset(Dataset):

    def __init__(self, size, length):
        self.len = length
        self.data = torch.randn(length, size)

    def __getitem__(self, index):
        return self.data[index]

    def __len__(self):
        return self.len


class BoringModel(LightningModule):

    def __init__(self):
        super().__init__()
        self.layer = torch.nn.Linear(32, 2)

    def forward(self, x):
        return self.layer(x)

    def training_step(self, batch, batch_idx):
        print(f"on device {batch.device.index} the value of self.device is {self.device}")
        output = self.layer(batch)
        return output.sum()

    def configure_optimizers(self):
        optimizer = torch.optim.SGD(self.layer.parameters(), lr=0.1)
        lr_scheduler = torch.optim.lr_scheduler.StepLR(optimizer, step_size=1)
        return [optimizer], [lr_scheduler]


if __name__ == '__main__':
    train_data = torch.utils.data.DataLoader(RandomDataset(32, 64), batch_size=2)
    model = BoringModel()
    trainer = Trainer(
        default_root_dir=os.getcwd(),
        limit_train_batches=1,
        limit_val_batches=1,
        max_epochs=1,
        weights_summary=None,
        accelerator="dp",
        gpus=2,
    )
    trainer.fit(model, train_data)
Output of this script is:
on device 0 the value of self.device is cuda:0
on device 1 the value of self.device is cuda:0