I think the error is thrown in
x1 = x.resize_(...)

If you run it on CPU, you will get:

RuntimeError: cannot resize variables that require grad

I think you could try to upsample your tensor with grid_sample 15.