Skip to content

Can LayerInfo.depth_index really be None? #347

Open
@ego-thales

Description

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions