v.data.resize_(data.size()).copy_(data)
RuntimeError: set_sizes_contiguous is not allowed on Tensor created from .data or .detach()报错
原因:版本问题
解决方法:使用
v.resize_(data.size()).copy_(data)
v.data.resize_(data.size()).copy_(data)
RuntimeError: set_sizes_contiguous is not allowed on Tensor created from .data or .detach()报错
原因:版本问题
解决方法:使用
v.resize_(data.size()).copy_(data)