torch.Tensor.new_tensor
Tensor.new_tensor(data, *, dtype=None, device=None, requires_grad=False, layout=torch.strided, pin_memory=False) -> Tensor
Returns a new Tensor with "data" as the tensor data. By default,
   the returned Tensor has the same "torch.dtype" and "torch.device"
   as this tensor.
Warning:
 "new_tensor()" always copies "data". If you have a Tensor "data"
 and want to avoid a copy, use "torch.Tensor.requires_grad_()" or
 "torch.Tensor.detach()". If you have a numpy array and want to
 avoid a copy, use "torch.from_numpy()".

Warning:
 When data is a tensor *x*, "new_tensor()" reads out 'the data'
 from whatever it is passed, and constructs a leaf variable.
 Therefore "tensor.new_tensor(x)" is equivalent to
 "x.clone().detach()" and "tensor.new_tensor(x,
 requires_grad=True)" is equivalent to
 "x.clone().detach().requires_grad_(True)". The equivalents using
 "clone()" and "detach()" are recommended.
