Skip to content
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

Can LayerInfo.depth_index really be None? #347

Open
ego-thales opened this issue Feb 7, 2025 · 0 comments
Open

Can LayerInfo.depth_index really be None? #347

ego-thales opened this issue Feb 7, 2025 · 0 comments

Comments

@ego-thales
Copy link
Contributor

ego-thales commented Feb 7, 2025

Hello !

Not sure this is actually an "issue".

I was wondering if there any use cases where a LayerInfo.depth_index from a summary_list could be None?
Because it is typed as follows and may raise type checking issue when considering it can be None.

self.depth_index: int | None = None # set at the very end

Of course it is easy to monkey patch by checking for None and eventually cast (even though mypy generally understands by itself the disjunction). Still, if it never arisses, it seems a bit weird to do it on the user side and not inside torchinfo.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant