Skip to content

[proto] Some fixes for crestereo#6791

Merged
YosuaMichael merged 2 commits intopytorch:mainfrom
YosuaMichael:proto/fix-crestereo
Oct 19, 2022
Merged

[proto] Some fixes for crestereo#6791
YosuaMichael merged 2 commits intopytorch:mainfrom
YosuaMichael:proto/fix-crestereo

Conversation

@YosuaMichael
Copy link
Copy Markdown
Contributor

  • Add default None for the flow_init in the forward (so user no need to explicitly specify it)
  • Fix mypy complain
  • Do verify weights, so user can use string as input (use model = crestereo_base(weights="DEFAULT") )

l_pyramid: Dict[str, Tensor] = {res: l_pyramid[idx] for idx, res in enumerate(self.resolutions)}
r_pyramid: Dict[str, Tensor] = {res: r_pyramid[idx] for idx, res in enumerate(self.resolutions)}
net_pyramid: Dict[str, Tensor] = {res: net_pyramid[idx] for idx, res in enumerate(self.resolutions)}
ctx_pyramid: Dict[str, Tensor] = {res: ctx_pyramid[idx] for idx, res in enumerate(self.resolutions)}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My local mypy complains:

crestereo.py:784: error: Name "l_pyramid" already defined on line 778
crestereo.py:785: error: Name "r_pyramid" already defined on line 779
crestereo.py:786: error: Name "net_pyramid" already defined on line 780
crestereo.py:787: error: Name "ctx_pyramid" already defined on line 781
Found 4 errors in 1 file (checked 1 source file)

and removing the type declaration seems to fix it.

Copy link
Copy Markdown
Contributor

@jdsgomes jdsgomes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks

@YosuaMichael YosuaMichael merged commit 7a62a54 into pytorch:main Oct 19, 2022
facebook-github-bot pushed a commit that referenced this pull request Oct 21, 2022
Reviewed By: YosuaMichael

Differential Revision: D40588159

fbshipit-source-id: a04a58a93a75ecd09223a970f4ec3333cc79d991
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants