Guest User

Untitled

a guest
Oct 21st, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. import torch
  2.  
  3.  
  4. def cast(cuda):
  5. if cuda:
  6. return lambda x: x.cuda()
  7. else:
  8. return lambda x: x
  9.  
  10.  
  11. torch.cast = cast(False)
  12. a = torch.cast(torch.rand(3, 3))
Add Comment
Please, Sign In to add comment