You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to the changes for tensors in 0.4, Modules should also get a .device attribute to allow easy creation of correct tensors.
Use case:
class Net(Module):
def forward(self, x):
x = x.to(self.device)
net = Net().cuda()
net.forward(Tensor([1])) # Don't need conditional or additional .to()
skelleher, chanshing, shaibagon, zeroows, shoaibahmed and 32 more