Skip to content

Conversation

AnirudhDagar
Copy link
Contributor

Closed #3982 in favour of this PR. This fixes the Group B in #3945.
Extremely sorry for the confusion @NicolasHug.

  • test_accimage_crop
  • test_accimage_pil_to_tensor
  • test_accimage_resize
  • test_accimage_to_tensor

assert np.abs((expected_output - output).mean()) < 1e-3
assert (expected_output - output).var() < 1e-5
# note the high absolute tolerance
self.assertTrue(np.allclose(output.numpy(), expected_output.numpy(), atol=5e-2))
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be torch.testing.assert_close(output.numpy(), expected_output.numpy())\maybe you'll need to adjust atol and rtol too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Though I've made the changes as suggested, since I don't have support for accimage these tests are skipped on my local machine and I'm not sure how to verify the atol and rtol values. Any ideas?

Copy link
Member

Choose a reason for hiding this comment

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

You did well using the numpy's default for rtol. Looks like the CI doesn't even run those tests anyway... that's not good lol.

Copy link
Contributor Author

@AnirudhDagar AnirudhDagar Jun 8, 2021

Choose a reason for hiding this comment

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

Exactly! I had the same doubt and I checked that CI was also skipping them so I used the numpy default rtol and atol as before.

Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

Thanks @AnirudhDagar !!

@NicolasHug NicolasHug merged commit 27bdb8c into pytorch:master Jun 8, 2021
@AnirudhDagar AnirudhDagar deleted the refactor-test-accimage_fixed branch June 8, 2021 09:16
facebook-github-bot pushed a commit that referenced this pull request Jun 14, 2021
Reviewed By: fmassa

Differential Revision: D29097728

fbshipit-source-id: 14f243179f6617fc0ede63ee5bb68f94954a62b9
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