How to do repeat operation like numpy.repeat in pytorch on Variable like tensor?
Assume that I have got a tensor like below: Are there any good approaches for doing above operation?
mderakhshani
Is this what you are looking for? You may want to copy() it after that if you actually need to change 7x7 panes independently.
Veril
mderakhshani
You should also look into torch.repeat. That’s also similar and useful in some cases!
SpandanMadan
When should you use repeat vs expand?
himat
‘repeat’ copies the original data and allocates new memory and ‘expand’ creates a new view on the existing tensor.
Qing_En