Init tensors using type_as for multi gpu training error
I get the following error when using type_as for multi device trainig:
TypeError: type_as() got an unexpected keyword argument 'device'
Code to reproduce:
!pip install torchvision
!pip install pytorch-lightning==0.8.3 --upgrade 

class MNISTModel(pl.LightningModule):

    def __init__(self):
        super(MNISTModel, self).__init__()
        self.l1 = torch.nn.Linear(28 * 28, 10)

    def forward(self, x):
        return torch.relu(self.l1(x.view(x.size(0), -1)))

    def training_step(self, batch, batch_nb):
        x, y = batch
        loss = F.cross_entropy(self(x), y)
        tensorboard_logs = {'train_loss': loss}
        #test multi gpu use compatibility
        some_var = torch.tensor([1,3])
        some_var = some_var.type_as(x, device=self.device)
        return {'loss': loss, }

    def configure_optimizers(self):
        return torch.optim.Adam(self.parameters(), lr=0.02)

train_loader = DataLoader(MNIST(os.getcwd(), train=True, download=True, transform=transforms.ToTensor()), batch_size=32)

mnist_model = MNISTModel()
trainer = pl.Trainer(gpus=1, progress_bar_refresh_rate=20)    
trainer.fit(mnist_model, train_loader) 


error:
<ipython-input-9-2eae42e2fcba> in training_step(self, batch, batch_nb)
     13         tensorboard_logs = {'train_loss': loss}
     14         some_var = torch.tensor([1,3])
---> 15         some_var = some_var.type_as(x, device=self.device)
     16         return {'loss': loss, }
     17 

TypeError: type_as() got an unexpected keyword argument 'device'