@@ -55,8 +55,7 @@ class VideoDecoder:
5555 decoding which is best if you are running a single instance of ``VideoDecoder``.
5656 Passing 0 lets FFmpeg decide on the number of threads.
5757 Default: 1.
58- device (str or torch.device, optional): The device to use for decoding.
59- If ``None`` (default), uses the current default device.
58+ device (str or torch.device, optional): The device to use for decoding. Default: "cpu".
6059 If you pass a CUDA device, we recommend trying the "beta" CUDA
6160 backend which is faster! See :func:`~torchcodec.decoders.set_cuda_backend`.
6261 seek_mode (str, optional): Determines if frame access will be "exact" or
@@ -103,7 +102,7 @@ def __init__(
103102 stream_index : Optional [int ] = None ,
104103 dimension_order : Literal ["NCHW" , "NHWC" ] = "NCHW" ,
105104 num_ffmpeg_threads : int = 1 ,
106- device : Optional [Union [str , torch_device ]] = None ,
105+ device : Optional [Union [str , torch_device ]] = "cpu" ,
107106 seek_mode : Literal ["exact" , "approximate" ] = "exact" ,
108107 custom_frame_mappings : Optional [
109108 Union [str , bytes , io .RawIOBase , io .BufferedReader ]
@@ -144,9 +143,7 @@ def __init__(
144143 if num_ffmpeg_threads is None :
145144 raise ValueError (f"{ num_ffmpeg_threads = } should be an int." )
146145
147- if device is None :
148- device = str (torch .get_default_device ())
149- elif isinstance (device , torch_device ):
146+ if isinstance (device , torch_device ):
150147 device = str (device )
151148
152149 device_variant = _get_cuda_backend ()
0 commit comments