-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added wrap_dataset_for_transforms_v2 into datasets and handled beta w… (
#7279) Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
- Loading branch information
1 parent
56b0497
commit ac1512b
Showing
7 changed files
with
88 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import pytest | ||
|
||
|
||
def test_warns_if_imported_from_datasets(mocker): | ||
mocker.patch("torchvision._WARN_ABOUT_BETA_TRANSFORMS", return_value=True) | ||
|
||
import torchvision | ||
|
||
with pytest.warns(UserWarning, match=torchvision._BETA_TRANSFORMS_WARNING): | ||
from torchvision.datasets import wrap_dataset_for_transforms_v2 | ||
|
||
assert callable(wrap_dataset_for_transforms_v2) | ||
|
||
|
||
@pytest.mark.filterwarnings("error") | ||
def test_no_warns_if_imported_from_datasets(): | ||
from torchvision.datasets import wrap_dataset_for_transforms_v2 | ||
|
||
assert callable(wrap_dataset_for_transforms_v2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters