facebookresearch / synsin

View synthesis for the public.
http://www.robots.ox.ac.uk/~ow/synsin.html
Other
659 stars 93 forks source link

Handled `identity` variable referenced before assignment when no cuda available #33

Open MichaelCG8 opened 3 years ago

MichaelCG8 commented 3 years ago

identity is defined in the if torch.cuda.is_available() block. This PR defines it in an else block for non-cuda systems.

facebook-github-bot commented 3 years ago

Hi @MichaelCG8!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

MichaelCG8 commented 3 years ago

CLA signed, awaiting update.

If input_img = input_img.cuda() does not affect the result of input_img.size(0), it would be cleaner to assign to identity above the if statement, and add identity = identity.cuda() inside the if. This would eliminate the need for the else.

facebook-github-bot commented 3 years ago

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!