Fix examples that uses type_as (#1129)
This commit is contained in:
parent
c0bedd2587
commit
2232eb35d1
|
@ -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
|
||||
^^^^^^^^^^^^^^^
|
||||
|
|
|
@ -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)
|
||||
|
||||
----------
|
||||
|
||||
|
|
Loading…
Reference in New Issue