question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
TylerYepcommented, Feb 24, 2022

Yep, AvgPool is definitely on the todo list. PRs adding support for these are greatly appreciated!

1reaction
TylerYepcommented, Feb 17, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found