prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  How to install torchvision to use video_reader backend?
  I simply installed torchvision from conda (as advertised on pytorch.org). But `torchvision.set_video_backend('video_reader')` prints `video_reader video backend is not available. Please compile torchvision from source and try again`. This should be mentioned in https://pytorch.org/docs/stable/torchvision/index.html#torchvision.set_video_backend and in torchvision README (including if the `video_reader` is temporarily not supported)
  
  cc @bjuncek
  
  </issue>
  <code>
  [start of torchvision/__init__.py]
  1 import warnings
  2 import os
  3 
  4 from .extension import _HAS_OPS
  5 
  6 from torchvision import models
  7 from torchvision import datasets
  8 from torchvision import ops
  9 from torchvision import transforms
  10 from torchvision import utils
  11 from torchvision import io
  12 
  13 import torch
  14 
  15 try:
  16     from .version import __version__  # noqa: F401
  17 except ImportError:
  18     pass
  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 
  28 _image_backend = 'PIL'
  29 
  30 _video_backend = "pyav"
  31 
  32 
  33 def set_image_backend(backend):
  34     """
  35     Specifies the package used to load images.
  36 
  37     Args:
  38         backend (string): Name of the image backend. one of {'PIL', 'accimage'}.
  39             The :mod:`accimage` package uses the Intel IPP library. It is
  40             generally faster than PIL, but does not support as many operations.
  41     """
  42     global _image_backend
  43     if backend not in ['PIL', 'accimage']:
  44         raise ValueError("Invalid backend '{}'. Options are 'PIL' and 'accimage'"
  45                          .format(backend))
  46     _image_backend = backend
  47 
  48 
  49 def get_image_backend():
  50     """
  51     Gets the name of the package used to load images
  52     """
  53     return _image_backend
  54 
  55 
  56 def set_video_backend(backend):
  57     """
  58     Specifies the package used to decode videos.
  59 
  60     Args:
  61         backend (string): Name of the video backend. one of {'pyav', 'video_reader'}.
  62             The :mod:`pyav` package uses the 3rd party PyAv library. It is a Pythonic
  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.
  67     """
  68     global _video_backend
  69     if backend not in ["pyav", "video_reader"]:
  70         raise ValueError(
  71             "Invalid video backend '%s'. Options are 'pyav' and 'video_reader'" % backend
  72         )
  73     if backend == "video_reader" and not io._HAS_VIDEO_OPT:
  74         message = (
  75             "video_reader video backend is not available."
  76             " Please compile torchvision from source and try again"
  77         )
  78         warnings.warn(message)
  79     else:
  80         _video_backend = backend
  81 
  82 
  83 def get_video_backend():
  84     return _video_backend
  85 
  86 
  87 def _is_tracing():
  88     return torch._C._get_tracing_state()
  89
  [end of torchvision/__init__.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/torchvision/__init__.py b/torchvision/__init__.py
  --- a/torchvision/__init__.py
  +++ b/torchvision/__init__.py
  @@ -64,6 +64,10 @@
               The :mod:`video_reader` package includes a native C++ implementation on
               top of FFMPEG libraries, and a python API of TorchScript custom operator.
               It is generally decoding faster than :mod:`pyav`, but perhaps is less robust.
  +
  +    .. note::
  +        Building with FFMPEG is disabled by default in the latest master. If you want to use the 'video_reader'
  +        backend, please compile torchvision from source.
       """
       global _video_backend
       if backend not in ["pyav", "video_reader"]:
  
verification_info: {"golden_diff": "diff --git a/torchvision/__init__.py b/torchvision/__init__.py\n--- a/torchvision/__init__.py\n+++ b/torchvision/__init__.py\n@@ -64,6 +64,10 @@\n             The :mod:`video_reader` package includes a native C++ implementation on\n             top of FFMPEG libraries, and a python API of TorchScript custom operator.\n             It is generally decoding faster than :mod:`pyav`, but perhaps is less robust.\n+\n+    .. note::\n+        Building with FFMPEG is disabled by default in the latest master. If you want to use the 'video_reader'\n+        backend, please compile torchvision from source.\n     \"\"\"\n     global _video_backend\n     if backend not in [\"pyav\", \"video_reader\"]:\n", "issue": "How to install torchvision to use video_reader backend?\nI simply installed torchvision from conda (as advertised on pytorch.org). But `torchvision.set_video_backend('video_reader')` prints `video_reader video backend is not available. Please compile torchvision from source and try again`. This should be mentioned in https://pytorch.org/docs/stable/torchvision/index.html#torchvision.set_video_backend and in torchvision README (including if the `video_reader` is temporarily not supported)\n\ncc @bjuncek\n", "before_files": [{"content": "import warnings\nimport os\n\nfrom .extension import _HAS_OPS\n\nfrom torchvision import models\nfrom torchvision import datasets\nfrom torchvision import ops\nfrom torchvision import transforms\nfrom torchvision import utils\nfrom torchvision import io\n\nimport torch\n\ntry:\n    from .version import __version__  # noqa: F401\nexcept ImportError:\n    pass\n\n# Check if torchvision is being imported within the root folder\nif (not _HAS_OPS and os.path.dirname(os.path.realpath(__file__)) ==\n        os.path.join(os.path.realpath(os.getcwd()), 'torchvision')):\n    message = ('You are importing torchvision within its own root folder ({}). '\n               'This is not expected to work and may give errors. Please exit the '\n               'torchvision project source and relaunch your python interpreter.')\n    warnings.warn(message.format(os.getcwd()))\n\n_image_backend = 'PIL'\n\n_video_backend = \"pyav\"\n\n\ndef set_image_backend(backend):\n    \"\"\"\n    Specifies the package used to load images.\n\n    Args:\n        backend (string): Name of the image backend. one of {'PIL', 'accimage'}.\n            The :mod:`accimage` package uses the Intel IPP library. It is\n            generally faster than PIL, but does not support as many operations.\n    \"\"\"\n    global _image_backend\n    if backend not in ['PIL', 'accimage']:\n        raise ValueError(\"Invalid backend '{}'. Options are 'PIL' and 'accimage'\"\n                         .format(backend))\n    _image_backend = backend\n\n\ndef get_image_backend():\n    \"\"\"\n    Gets the name of the package used to load images\n    \"\"\"\n    return _image_backend\n\n\ndef set_video_backend(backend):\n    \"\"\"\n    Specifies the package used to decode videos.\n\n    Args:\n        backend (string): Name of the video backend. one of {'pyav', 'video_reader'}.\n            The :mod:`pyav` package uses the 3rd party PyAv library. It is a Pythonic\n            binding for the FFmpeg libraries.\n            The :mod:`video_reader` package includes a native C++ implementation on\n            top of FFMPEG libraries, and a python API of TorchScript custom operator.\n            It is generally decoding faster than :mod:`pyav`, but perhaps is less robust.\n    \"\"\"\n    global _video_backend\n    if backend not in [\"pyav\", \"video_reader\"]:\n        raise ValueError(\n            \"Invalid video backend '%s'. Options are 'pyav' and 'video_reader'\" % backend\n        )\n    if backend == \"video_reader\" and not io._HAS_VIDEO_OPT:\n        message = (\n            \"video_reader video backend is not available.\"\n            \" Please compile torchvision from source and try again\"\n        )\n        warnings.warn(message)\n    else:\n        _video_backend = backend\n\n\ndef get_video_backend():\n    return _video_backend\n\n\ndef _is_tracing():\n    return torch._C._get_tracing_state()\n", "path": "torchvision/__init__.py"}]}