* added self.device

* added docs
This commit is contained in:
William Falcon authored and GitHub committed 2020-05-12 00:09:48 -04:00
1 parent de1fdd8d3b
commit 4b30ef6480
5 files changed
+13 -1

No files matched your search

+3 -1
View File
@@ -46,7 +46,9 @@ This will make your code scale to any arbitrary number of GPUs or TPUs with Ligh
# with lightning
def forward(self, x):
z = torch.Tensor(2, 3)
z = z.type_as(x)
z = z.type_as(x, device=self.device)
Every LightningModule knows what device it is on. You can access that reference via `self.device`.
Remove samplers
^^^^^^^^^^^^^^^