pytorch-cpn icon indicating copy to clipboard operation
pytorch-cpn copied to clipboard

target.cuda(async=True),在async=True处出现SyntaxError: invalid syntax

Open my-hello-world opened this issue 5 years ago • 1 comments

相关资料不是很直观,想问下我直接把

        refine_target_var = torch.autograd.Variable(target7.cuda(async=True))
        valid_var = torch.autograd.Variable(valid.cuda(async=True))

改成如下可以吗?

        refine_target_var = torch.autograd.Variable(target7.cuda())
        valid_var = torch.autograd.Variable(valid.cuda())

my-hello-world avatar Jun 18 '19 04:06 my-hello-world

yes.you can use the .cuda() here is the reference

Crophone avatar Jul 11 '20 07:07 Crophone