Unverified Commit 1fc53b28 authored by Prabhat Roy's avatar Prabhat Roy Committed by GitHub
Browse files

Update attribute name for readability (#5484)

parent bb83e5b5
......@@ -3,7 +3,7 @@ import os
import pytest
import torch
from torchvision.io import _HAS_VIDEO_DECODER, VideoReader
from torchvision.io import _HAS_GPU_VIDEO_DECODER, VideoReader
try:
import av
......@@ -13,7 +13,7 @@ except ImportError:
VIDEO_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "assets", "videos")
@pytest.mark.skipif(_HAS_VIDEO_DECODER is False, reason="Didn't compile with support for gpu decoder")
@pytest.mark.skipif(_HAS_GPU_VIDEO_DECODER is False, reason="Didn't compile with support for gpu decoder")
class TestVideoGPUDecoder:
@pytest.mark.skipif(av is None, reason="PyAV unavailable")
@pytest.mark.parametrize(
......
......@@ -5,9 +5,9 @@ import torch
from ..utils import _log_api_usage_once
try:
from ._load_gpu_decoder import _HAS_VIDEO_DECODER
from ._load_gpu_decoder import _HAS_GPU_VIDEO_DECODER
except ModuleNotFoundError:
_HAS_VIDEO_DECODER = False
_HAS_GPU_VIDEO_DECODER = False
from ._video_opt import (
Timebase,
VideoMetaData,
......@@ -119,7 +119,7 @@ class VideoReader:
self.is_cuda = False
device = torch.device(device)
if device.type == "cuda":
if not _HAS_VIDEO_DECODER:
if not _HAS_GPU_VIDEO_DECODER:
raise RuntimeError("Not compiled with GPU decoder support.")
self.is_cuda = True
if device.index is None:
......@@ -218,7 +218,7 @@ __all__ = [
"_read_video_timestamps_from_memory",
"_probe_video_from_memory",
"_HAS_VIDEO_OPT",
"_HAS_VIDEO_DECODER",
"_HAS_GPU_VIDEO_DECODER",
"_read_video_clip_from_memory",
"_read_video_meta_data",
"VideoMetaData",
......
......@@ -3,6 +3,6 @@ from ..extension import _load_library
try:
_load_library("Decoder")
_HAS_VIDEO_DECODER = True
_HAS_GPU_VIDEO_DECODER = True
except (ImportError, OSError):
_HAS_VIDEO_DECODER = False
_HAS_GPU_VIDEO_DECODER = False
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment