I think permute and flip should work here:
x = torch.zeros(135, 240)
# Draw reference lines
x[:, 0:10] = torch.arange(x.size(0)).unsqueeze(1).float()
x[0:10, :] = torch.arange(x.size(1)).unsqueeze(0).float() * 2

plt.imshow(x.numpy())

x_trans = x.permute(1, 0).flip(0)
plt.imshow(x_trans.numpy())