Starting from the current nightly build (and PyTorch 1.5 soon), for
pad_img[: img.shape[0], : img.shape[1], : img.shape[2]].copy_(img)

we can write
using namespace torch::indexing;
pad_img.index({Slice(None, img.size(0)), Slice(None, img.size(1)), Slice(None, img.size(2))}).copy_(img)

Here is the general translation for Tensor::index and Tensor::index_put_ functions:
Python             C++ (assuming `using namespace at::indexing`)
-------------------------------------------------------------------
0                  0
None               None
...                "..." or Ellipsis
:                  Slice()
start:stop:step    Slice(start, stop, step)
True / False       true / false
[[1, 2]]           torch::tensor({{1, 2}})