amarczew / pytorch_model_summary

MIT License
52 stars 15 forks source link

Submodule can be None and should be ignored by hierarchical_summary #4

Closed daniel347x closed 4 years ago

daniel347x commented 4 years ago

My model has different run conditions, and in some a submodule is set to None after initial load and not accessed any further. The hierarchical_summary function does not consider this possibility. Checking for the condition that a submodule is None 100% resolves the issue. Thanks!

amarczew commented 4 years ago

@daniel347x although this a special case, I'm going to merge it. If pytorch allows this, lets allow here as well :smile:

Thanks for your PR!! It will be included in the next version.