-
Notifications
You must be signed in to change notification settings - Fork 6.1k
[Type Hint] Unet Models #330
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ def __init__( | |
attention_head_dim=8, | ||
norm_num_groups=32, | ||
norm_eps=1e-5, | ||
): | ||
) -> None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice @sidthekidder, could you maybe also give all the init values some type hints? I've shown one example above :-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @patrickvonplaten yeah, but it has become more of a soft requirement for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah agree here think it's also cleaner to not have a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, no return annotation for the constructor is cleaner - removed |
||
super().__init__() | ||
|
||
self.sample_size = sample_size | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -30,7 +30,7 @@ def __init__( | |||||
norm_eps=1e-5, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Could you give all those values some type hints as well? :-) |
||||||
cross_attention_dim=1280, | ||||||
attention_head_dim=8, | ||||||
): | ||||||
) -> None: | ||||||
super().__init__() | ||||||
|
||||||
self.sample_size = sample_size | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello
From issue #287, I see that type hints are required for all the variables. So would you be adding the type hints for other variables as well? Or is this PR out of scope for all of them?
Here are some examples:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the examples @vishnu-anirudh and @patrickvonplaten - I added type hints for other
__init__
variables as well.