If img is your image, then torch.cat((img, img, img), 2) will work. However, maybe this is not what you really want to do. If you could refit your model to receive greyscale images, it could improve the performance of your model.