Fix examples that uses type_as (#1129)

This commit is contained in:
Ibraheem Moosa
2020-03-14 13:02:31 -04:00
committed by GitHub
parent c0bedd2587
commit 2232eb35d1
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ 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.type())
z = z.type_as(x)
Remove samplers
^^^^^^^^^^^^^^^
+1 -1
View File
@@ -228,7 +228,7 @@ When you init a new tensor in your code, just use type_as
# put the z on the appropriate gpu or tpu core
z = sample_noise()
z = z.type_as(x.type())
z = z.type_as(x)
----------