Copy the elements of the given tensor
. The number of elements must match, but
the sizes might be different.
> x = torch.Tensor(4):fill(1) > y = torch.Tensor(2,2):copy(x) > print(x) 1 1 1 1 [torch.Tensor of dimension 4] > print(y) 1 1 1 1 [torch.Tensor of dimension 2x2]
If a different type of tensor
is given, then a type conversion occurs,
which, of course, might result in lost of precision.