snip3r77:

So basically we’re doing an .unsqueeze(1) is because we wanted to match the shape. It’s grayscale hence we need to add the channel at axis =1 ?


It depends, what you want to do with this tensor.
If you want to pass it to a 2D CNN, then you would have to provide an input shape of [batch_size, channels, height, width]. Since the channel dimension might be missing, you would have to unsqueeze it.



 snip3r77:

The codes are bundled and I can’t run step by step. Is there a tutorial on this?


Could you run the cells separately for debugging purposes?
I’m not familiar with the course, but where are you stuck?