8/20/2020

RuntimeError: set_sizes_contiguous is not allowed on Tensor created from .data or .detach(), in Pytorch 1.1.0

change old -> new 


old

v.data.resize_(data.size()).copy_(data)


NEW

with torch.no_grad():
    v.resize_(data.size()).copy_(data)

No comments:

Post a Comment