There seems to be several ways to create a copy of a tensor in Pytorch, including
y = tensor.new_tensor(x) #a
y = x.clone().detach()... moreThere seems to be several ways to create a copy of a tensor in Pytorch, including
y = tensor.new_tensor(x) #a
y = x.clone().detach() #b
y = torch.empty_like(x).copy_(x) #c
y = torch.tensor(x) #d
b is explicitly preferred over a and d according to a UserWarning I get if I execute either a or d. Why is it preferred? Performance? I'd argue it's less readable.Any reasons for/against using c?