Also this questions sounds like it’s coming from an assignment and is similar to your other post 8.
I’m sure we can help with any PyTorch-related questions, but in case I’m right and you are indeed trying to get answers for some kind of quiz, I’m hesitant to help solving it for you.
Having worked at a University before, I would be quite disappointed if our students would ask for direct support for these kind of questions.