@eqy Thanks for replying.
Yes, I changed it and it works now. But I don’t understand what you did there. I would like to know how you found out if there is a “functional” use of torch.flatten in ResNet18? Also, why is it used?