Sorry for not being completely clear about my requirement.
I want to extend the tensor t2 to be the same size as t1 where the “extra values that need to be filled in t2” can be some unique number that is currently not in t2. For instance,
t2 = torch.tensor([ 1, 24, 0, 0, 0])
I tried it with
t2.data.resize_as_(t1)
That sort of works but it doesn’t give the flexibility to fill in using our own values.