-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flops are counted multiple times if a module is shared by other modules #106
Comments
Hi! Yeah, that's a drawback of the tracing process. Since it doesn't affect the output value, I'd consider it as a minor one. I'll have a look if a simple fix is possible. |
I added more meaningful warning for that case in #109 |
Hi, @sovrasov Thanks! |
By the output value I assume the return value of get_model_complexity_info, and it is not affected. For calculating extended statistics during model printing, I use a different mechanism, which can not handle shared submodules, and therefore counts parameters of shared submodules several times. |
If a module is passed to a sub-module, for example:
then, the flops of module
nn.Linear(1000, 1000)
will be counted twice inTest_model
andBlock
:The text was updated successfully, but these errors were encountered: