Skip to content

42. Make Predictions with Model #1167

Closed Answered by 37Lime
ishashankkawle asked this question in Q&A
Discussion options

You must be logged in to vote

Hi there,

What I am not understanding is when we create an object of class and try to do prediction in inference mode, how is it triggering the forward method in below code?

This is because a __call__() method is defined in nn.Module.

For the second question, with torch.inference_mode(): alters properties related to training. You can read more about it in the documentation. If it is the with part of the statement you want to know more about, have a look at this discussion.

Best wishes.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ishashankkawle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants