'What is the difference between "modules" and "functionals" in PyTorch?

In PyTorch, we have torch.nn.funtional and torch.nn, and the classes/functions within the former are typically referred to as "functions" while the latter as "modules".

There seems to be a lot of overlap between the two, so I'm wondering what are each used for and what their differences are?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source