First of all, PyTorch is a very good library for deep learning researchers. I would like to contribute to the improvement of PyTorch. I have a few questions as below.
I want to easily find the code path for a particular function or class.
For example, there is torch.nn.CrossEntropyLoss which is not defined in torch/nn but is defined in torch/nn/modules/loss.py.
Is there a way to easily find the code path?
We can import CrossEntropyLoss class using import torch.nn.CrossEntropy or import torch.nn.modues.loss.CrossEntropy. How does the former work?
Goal here I would assume they wanted people to be able to call all these numerous classes or functions simply from torch.nn and not have one massive file containing all of them
my bad I see what you mean on question 3 I missed before read to quickly. L1Loss seemed to have name remap to AbsCriterion. so code under AbsCriterion. You will find that the case for these others as well: