Open hdnh2006 opened 1 year ago
If in the function transform (https://github.com/hdnh2006/cartoonify/blob/a37167c5cda7a56362395271d30aecd5098bbbcd/cartoongan/test_from_code.py#L14) we set gpu = 0. The code fails because torch.FloatTensor([n]) is not set in the same device as var, so the operation
transform
gpu = 0
torch.FloatTensor([n])
var = var.unsqueeze(2).unsqueeze(3).expand_as(x) * ( (n - 1) / torch.FloatTensor([n]).to(var.device) )
will fail...
If in the function
transform
(https://github.com/hdnh2006/cartoonify/blob/a37167c5cda7a56362395271d30aecd5098bbbcd/cartoongan/test_from_code.py#L14) we setgpu = 0
. The code fails becausetorch.FloatTensor([n])
is not set in the same device as var, so the operationwill fail...