Thanks @zetyquickly for your reply. Yes, error is nothing to do with PyTorch. Please take a look at following image.

Screenshot from 2021-09-06 11-46-57897×597 89.4 KB

Since, I am using gray scale image channel number is 1 and is specified in the last position. Still gives the same error. What is wrong with that? Thanks again!