#1449 [DO NOT DELETE OR MERGE] Nightly build

Open ezyang Pseudo commit used to compare (fb516ba...44a5bae)
Missing base report.

Unable to compare commits because the base of the pull request did not upload a coverage report.

Changes found in between fb516ba...44a5bae (pseudo...base) which prevent comparing this pull request.

Showing 1 of 300 files from the diff.
Other files ignored by Codecov
.gitignore has changed.
setup.py has changed.
.travis.yml was deleted.
hubconf.py has changed.
test/test_ops.py has changed.
setup.cfg has changed.
test/test_hub.py has changed.
README.rst has changed.
test/test_io.py has changed.
CMakeLists.txt has changed.
mypy.ini is new.
test/test_onnx.py has changed.
.gitattributes has changed.

@@ -1,4 +1,7 @@
Loading
1 1
import warnings
2 +
import os
3 +
4 +
from .extension import _HAS_OPS
2 5
3 6
from torchvision import models
4 7
from torchvision import datasets
@@ -7,13 +10,21 @@
Loading
7 10
from torchvision import utils
8 11
from torchvision import io
9 12
10 -
from .extension import _HAS_OPS
13 +
import torch
11 14
12 15
try:
13 16
    from .version import __version__  # noqa: F401
14 17
except ImportError:
15 18
    pass
16 19
20 +
# Check if torchvision is being imported within the root folder
21 +
if (not _HAS_OPS and os.path.dirname(os.path.realpath(__file__)) ==
22 +
        os.path.join(os.path.realpath(os.getcwd()), 'torchvision')):
23 +
    message = ('You are importing torchvision within its own root folder ({}). '
24 +
               'This is not expected to work and may give errors. Please exit the '
25 +
               'torchvision project source and relaunch your python interpreter.')
26 +
    warnings.warn(message.format(os.getcwd()))
27 +
17 28
_image_backend = 'PIL'
18 29
19 30
_video_backend = "pyav"
@@ -49,18 +60,22 @@
Loading
49 60
    Args:
50 61
        backend (string): Name of the video backend. one of {'pyav', 'video_reader'}.
51 62
            The :mod:`pyav` package uses the 3rd party PyAv library. It is a Pythonic
52 -
                binding for the FFmpeg libraries.
53 -
            The :mod:`video_reader` package includes a native c++ implementation on
54 -
                top of FFMPEG libraries, and a python API of TorchScript custom operator.
55 -
                It is generally decoding faster than pyav, but perhaps is less robust.
63 +
            binding for the FFmpeg libraries.
64 +
            The :mod:`video_reader` package includes a native C++ implementation on
65 +
            top of FFMPEG libraries, and a python API of TorchScript custom operator.
66 +
            It is generally decoding faster than :mod:`pyav`, but perhaps is less robust.
56 67
    """
57 68
    global _video_backend
58 69
    if backend not in ["pyav", "video_reader"]:
59 70
        raise ValueError(
60 71
            "Invalid video backend '%s'. Options are 'pyav' and 'video_reader'" % backend
61 72
        )
62 73
    if backend == "video_reader" and not io._HAS_VIDEO_OPT:
63 -
        warnings.warn("video_reader video backend is not available")
74 +
        message = (
75 +
            "video_reader video backend is not available."
76 +
            " Please compile torchvision from source and try again"
77 +
        )
78 +
        warnings.warn(message)
64 79
    else:
65 80
        _video_backend = backend
66 81
@@ -70,5 +85,4 @@
Loading
70 85
71 86
72 87
def _is_tracing():
73 -
    import torch
74 88
    return torch._C._get_tracing_state()

Unable to process changes.

No base report to compare against.

250 Commits