Docs on `nn`
See original GitHub issueI think it’s important to document that all ops should be done via nn, else they won’t be tracked (in memory and flops). E.g. x.mean is invisible, as opposed to AvgPool1d (though its flops and memory still aren’t tracked). Would also help to detect if there are non-nn ops, or non-contributing layers like AvgPool1d and warn the user of potential inaccuracies (or document it).
That said, is there a way to ensure correctness for things like x = x + 1? Wrapping torch.add in nn.Module doesn’t do it.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
torch.nn — PyTorch 1.13 documentation
torch.nn. These are the basic building blocks for graphs: torch.nn. Containers. Convolution Layers.
Read more >nn - Read the Docs
This package provides an easy and modular way to build and train simple or complex neural networks using Torch: Modules are the bricks...
Read more >SIMPLE-NN - Read the Docs
Description. SIMPLE-NN (SNU Interatomic Machine-learning PotentiaL packagE – version Neural Network). Repository. https://github.com/MDIL-SNU/SIMPLE-NN.git ...
Read more >[docs] Improve docs of nn.MultiheadAttention #28721 - GitHub
https://pytorch.org/docs/master/nn.html?highlight=multiheadattention#torch.nn.MultiheadAttention currently looks like this: Note – if kdim ...
Read more >nbdev adds same (wrong) MLP info/source to docs for nn ...
I've noticed that classes that sub-class from nn.Module , typically get the same irrelevant simple network code and commentary added to the docs...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yep, AvgPool is definitely on the todo list. PRs adding support for these are greatly appreciated!
Totally agree, a lot of operations are not supported but definitely could in the future. I’ll add this to the documentation.
Note that torchinfo is built around supplementing information of print(model) in Pytorch, so it is unlikely we will list “add” operations and other non-layer operations. But rows that print(model) outputs but are missing from torchinfo should be considered a bug.