Closed prlz77 closed 6 years ago
Hi @prlz77
Thank you so much for your contribution -- I am actually working on this right now :)
I have just checked out the source for .apply()
:
http://pytorch.org/docs/master/_modules/torch/nn/modules/module.html
Yes, you are right that it traverses .children()
but it also calls .apply()
for each of them, meaning that it will also reach submodules. Can you give an example when this approach might not work?
Thank you.
Sorry, you are right! I need the .modules() but the fault is in my side.
My apologies to make you lose your time!
@prlz77 No worries at all :)
This flops counting module is new -- feel free to contribute more or leave your suggestions
Thank you.
Great script!
Btw, .apply() uses .children(), which may lead to skip convolutional layers in submodules. I replaced it for modules() for if you want to change it.