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
if use_cuda:
torch_t = torch.cuda
def from_numpy(ndarray):
return torch.from_numpy(ndarray).pin_memory().cuda(async=True)
The reason for this error is that async has become a reserved keyword from python 3.7. The cuda() constructor arguments have changed as well. This is how the new constructor looks -
cuda(device=None, non_blocking=False)
async=True can be replaced by non_blocking=True.
non_blocking (bool):
If True and the source is in pinned memory, the copy will be asynchronous with respect to the host. Otherwise, the argument has no effect. Default: False.
The text was updated successfully, but these errors were encountered:
if use_cuda:
torch_t = torch.cuda
def from_numpy(ndarray):
return torch.from_numpy(ndarray).pin_memory().cuda(async=True)
The reason for this error is that async has become a reserved keyword from python 3.7. The cuda() constructor arguments have changed as well. This is how the new constructor looks -
cuda(device=None, non_blocking=False)
async=True can be replaced by non_blocking=True.
non_blocking (bool):
If True and the source is in pinned memory, the copy will be asynchronous with respect to the host. Otherwise, the argument has no effect. Default: False.
The error occurs in this line.
The reason for this error is that
async
has become a reserved keyword from python 3.7. Thecuda()
constructor arguments have changed as well. This is how the new constructor looks -async=True
can be replaced bynon_blocking=True
.The text was updated successfully, but these errors were encountered: