mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-11 12:31:23 +08:00
Fix examples that uses type_as (#1129)
This commit is contained in:
@@ -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)
|
||||
|
||||
----------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user