Archived what is needed.
torch_tensor.permute would bring the required dimensions to end and then apply a nn.functional.pad with reflect option on the 4d tensor for the last two dimensions. Later permute it back to its original form.