Skip to content
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

Misc lint fixes #1020

Merged
merged 1 commit into from
Jun 14, 2019
Merged

Misc lint fixes #1020

merged 1 commit into from
Jun 14, 2019

Conversation

fmassa
Copy link
Member

@fmassa fmassa commented Jun 14, 2019

Those minor lint issues were caught when running tests in fb

@fmassa fmassa merged commit f052c53 into pytorch:master Jun 14, 2019
@fmassa fmassa deleted the misc-lint-fixes branch June 14, 2019 13:04
@@ -101,7 +101,7 @@ def __len__(self):
collate_fn=lambda x: x[0])
aspect_ratios = []
with tqdm(total=len(dataset)) as pbar:
for i, (img, _) in enumerate(data_loader):
for _i, (img, _) in enumerate(data_loader):
pbar.update(1)
height, width = img.shape[-2:]
aspect_ratio = float(height) / float(width)
Copy link
Contributor

Choose a reason for hiding this comment

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

@fmassa Shouldn't aspect_ratio be width/height?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the important thing in here is for it to be consistent between all the implementations, and I don't think it will change anything in this particular case.

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, it just looks weid to understand because it is different from other definition.

Copy link
Member Author

Choose a reason for hiding this comment

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

which definition?

Copy link
Contributor

Choose a reason for hiding this comment

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

Something like this and this, and also aspect_ratio = w / h is commonly defined in other places like computer graphics. Anyway, it doesn't affect the behavior in your code.

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe we can change this definition here without breaking the rest of the code. I would be willing to merge a PR that do this change.

Copy link
Contributor

Choose a reason for hiding this comment

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

@fmassa Please take a look at #1194

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants