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

refactor transforms v2 tests #7562

Merged
merged 53 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
c12991b
[PoC] refactor transforms v2 tests
pmeier May 8, 2023
597bde0
Merge branch 'main' into refactor-v2-tests
pmeier May 10, 2023
d5167c2
Merge branch 'main' into refactor-v2-tests
pmeier May 10, 2023
95672b4
Merge branch 'main' into refactor-v2-tests
pmeier May 18, 2023
9dfe0fb
complete kernel checks
pmeier May 18, 2023
aa52e9d
align parameter names
pmeier May 18, 2023
d35c381
add tolerance handling
pmeier May 19, 2023
3b3edd7
add tolerance handling and dispatcher tests
pmeier May 22, 2023
8082ed4
Merge branch 'main' into refactor-v2-tests
pmeier May 22, 2023
fde36a2
don't check device in CUDA vs CPU test
pmeier May 23, 2023
785d4d9
address small comments
pmeier May 23, 2023
c178d26
refactor tolerances
pmeier May 23, 2023
3e75473
Merge branch 'main' into refactor-v2-tests
pmeier May 24, 2023
3ee85ee
add batch dim parametrization
pmeier May 24, 2023
c4c2987
Merge branch 'main' into refactor-v2-tests
pmeier May 31, 2023
045b237
simplify batch checks
pmeier May 31, 2023
0f12486
reduce dispatcher parametrization
pmeier May 31, 2023
1c46b24
Merge branch 'main' into refactor-v2-tests
pmeier Jun 1, 2023
f6157f3
polish kernel and dispatcher tests
pmeier Jun 1, 2023
ff1fb6a
Merge branch 'main' into refactor-v2-tests
pmeier Jun 2, 2023
43877de
add transforms tests
pmeier Jun 19, 2023
8ab5374
add tests for extra warnings and errors
pmeier Jun 19, 2023
5f1a68b
fix antialias test
pmeier Jun 19, 2023
b94d8bc
add output size checks
pmeier Jun 19, 2023
959200a
Merge branch 'main' into refactor-v2-tests
pmeier Jun 19, 2023
87ff4ae
fix cuda tolerances
pmeier Jun 19, 2023
2547acd
address small comments
pmeier Jun 19, 2023
a83f9fb
improve bicubic cuda check
pmeier Jun 19, 2023
3b10248
properly parametrize over simple tensors and PIL images
pmeier Jun 19, 2023
50da561
add bicubic cuda comment
pmeier Jun 19, 2023
658c307
Merge branch 'main' into refactor-v2-tests
pmeier Jun 19, 2023
b25cef8
reorder tests
pmeier Jun 20, 2023
026e295
fix int interpolation test
pmeier Jun 20, 2023
6770596
fix warnings
pmeier Jun 20, 2023
d77baec
add noop test
pmeier Jun 20, 2023
ad7437d
add regression test
pmeier Jun 20, 2023
1ad491d
fix warnings
pmeier Jun 20, 2023
6ffeeb4
improve pil compat interpolation test
pmeier Jun 20, 2023
60c3023
fix format not being used in bbox test
pmeier Jun 20, 2023
dc5b4f1
use pre-defined PIL interpolation mode mapping
pmeier Jun 20, 2023
23b1599
improve noop test
pmeier Jun 20, 2023
e66bf4f
unify dispatcher checks
pmeier Jun 20, 2023
624b925
dont use MAE for correctness checks
pmeier Jun 20, 2023
ad06894
unify image correctness tests
pmeier Jun 20, 2023
9239eda
Merge branch 'main' into refactor-v2-tests
NicolasHug Jun 21, 2023
03667b0
Update test/test_transforms_v2_refactored.py
pmeier Jun 21, 2023
4deb952
reinstate high bicubic tolerance
pmeier Jun 21, 2023
33d3207
Merge branch 'refactor-v2-tests' of github.com:pmeier/vision into ref…
pmeier Jun 21, 2023
c496bfd
Merge branch 'main' into refactor-v2-tests
pmeier Jun 21, 2023
ff4c0ea
fix
pmeier Jun 21, 2023
d5358b9
remove most old v2 resize tests
pmeier Jun 21, 2023
5957d42
port bounding box correctness tests
pmeier Jun 21, 2023
db6b137
Merge branch 'main' into refactor-v2-tests
pmeier Jun 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions test/common_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
import os
import pathlib
import random
import re
import shutil
import sys
import tempfile
import warnings
from collections import defaultdict
from subprocess import CalledProcessError, check_output, STDOUT
from typing import Callable, Sequence, Tuple, Union
Expand Down Expand Up @@ -880,3 +882,23 @@ def assert_run_python_script(source_code):
raise RuntimeError(f"script errored with output:\n{e.output.decode()}")
if out != b"":
raise AssertionError(out.decode())


@contextlib.contextmanager
def assert_no_warnings():
# The name `catch_warnings` is a misnomer as the context manager does **not** catch any warnings, but rather scopes
# the warning filters. All changes that are made to the filters while in this context, will be reset upon exit.
with warnings.catch_warnings():
warnings.simplefilter("error")
yield


@contextlib.contextmanager
def ignore_jit_no_profile_information_warning():
# Calling a scripted object often triggers a warning like
# `UserWarning: operator() profile_node %$INT1 : int[] = prim::profile_ivalue($INT2) does not have profile information`
# with varying `INT1` and `INT2`. Since these are uninteresting for us and only clutter the test summary, we ignore
# them.
with warnings.catch_warnings():
warnings.filterwarnings("ignore", message=re.escape("operator() profile_node %"), category=UserWarning)
yield
Loading