animeGAN icon indicating copy to clipboard operation
animeGAN copied to clipboard

set_sizes_contiguous is not allowed on a Tensor created from .data or .detach().

Open athulvingt opened this issue 4 years ago • 0 comments

input.data.resize_(real_cpu.size()).copy_(real_cpu) RuntimeError: set_sizes_contiguous is not allowed on a Tensor created from .data or .detach(). If your intent is to change the metadata of a Tensor (such as sizes / strides / storage / storage_offset) without autograd tracking the change, remove the .data / .detach() call and wrap the change in a with torch.no_grad(): block. For example, change: x.data.set_(y) to: with torch.no_grad(): x.set_(y)

athulvingt avatar Dec 18 '19 11:12 athulvingt