Skip to content

Conversation

@pmeier
Copy link
Contributor

@pmeier pmeier commented Nov 28, 2022

This PR cleans up some minor thing in the prototype transforms test suite. I'm going to highlight them with inline comments.

cc @vfdev-5 @datumbox @bjuncek

*,
agg_method=None,
allowed_percentage_diff=None,
mae=False,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ported both agg_method and allowed_percentage diff from the stable tests. In the prototype tests we only ever used agg_method="mean". This just makes it more expressive by adding an mae=False flag instead.



def make_info_args_kwargs_parametrization(infos, *, args_kwargs_fn, condition=None):
if condition is None:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no need to have a condition that filters infos here, if we can simply filter them before passing them here.

expected,
**info.get_closeness_kwargs(test_id, dtype=input.dtype, device=input.device),
msg=parametrized_error_message(*other_args, *kwargs),
msg=parametrized_error_message(*other_args, **kwargs),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I botched this when I introduced the extra information. Without the ** we would only include the names of the parameters rather than the name-value-pair.

@pmeier pmeier requested a review from datumbox November 28, 2022 13:37
@pmeier pmeier marked this pull request as ready for review November 28, 2022 13:38
Copy link
Contributor

@datumbox datumbox left a comment

Choose a reason for hiding this comment

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

Thanks!

@pmeier pmeier merged commit 74ea933 into pytorch:main Nov 28, 2022
@pmeier pmeier deleted the proto-test-cleanup branch November 28, 2022 15:23
facebook-github-bot pushed a commit that referenced this pull request Dec 1, 2022
Summary:
* minor cleanup of the prototype transforms tests

* refactor ImagePair

* pretty format enum

Reviewed By: YosuaMichael

Differential Revision: D41648543

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