You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
Hello !
Not sure this is actually an "issue".
I was wondering if there any use cases where a
LayerInfo.depth_index
from asummary_list
could beNone
?Because it is typed as follows and may raise type checking issue when considering it can be
None
.torchinfo/torchinfo/layer_info.py
Line 47 in 890def3
Of course it is easy to monkey patch by checking for
None
and eventuallycast
(even thoughmypy
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 insidetorchinfo
.Thanks!
The text was updated successfully, but these errors were encountered: