In pytorch, how to fill a tensor with another tensor?
I'm looking for a way to expand the size of an image by adding 0 values to the right &amp; lower edges of it. My initial plan is to use nn.padding to add the edge, until I encounter this error:

  File "/home/shared/virtualenv/dl-torch/lib/python3.7/site-packages/torch/nn/functional.py", line 2796, in pad
    assert len(pad) % 2 == 0, 'Padding length must be divisible by 2'
AssertionError: Padding length must be divisible by 2


It appears that torch tries to pad the image from both side! Is there an easy way to override this and fill the tensor into the upper-left side of another image?

the only way I know is:
with torch.no_grad(): # assuming it's for init
  val = torch.distributions.MultivariateNormal(loc=zeros(2), scale=torch.eye(2))
  w.data =  val

but I doubt it's recommended.
Answering the title of the question.
