Exemple #1
0
 def __new__(
         cls,
         datapipe: Iterable[str],
         mode: str = 'b',
         length: int = -1):
     deprecation_warning(type(cls).__name__, new_name="FileOpener")
     return FileOpenerIterDataPipe(datapipe=datapipe, mode=mode, length=length)
Exemple #2
0
 def __init__(self,
              datapipe: Iterable[Tuple[str, BufferedIOBase]],
              *handlers: Callable,
              key_fn: Callable = extension_extract_fn) -> None:
     super().__init__()
     self.datapipe: Iterable[Tuple[str, BufferedIOBase]] = datapipe
     if not handlers:
         handlers = (decoder_basichandlers, decoder_imagehandler('torch'))
     self.decoder = Decoder(*handlers, key_fn=key_fn)
     deprecation_warning(type(self).__name__)
Exemple #3
0
 def __new__(cls,
             datapipe: Iterable[str],
             mode: str = 'b',
             length: int = -1):
     deprecation_warning(
         cls.__name__,
         deprecation_version="1.12",
         removal_version="1.14",
         new_class_name="FileOpener",
     )
     return FileOpenerIterDataPipe(datapipe=datapipe,
                                   mode=mode,
                                   length=length)