Shortcuts

FSSpecFileLister

class torchdata.datapipes.iter.FSSpecFileLister(root: str, masks: Union[str, List[str]] = '')

Lists the contents of the directory at the provided root pathname or URL, and yields the full pathname or URL for each file within the directory.

Parameters
  • root – The root fsspec path directory to list files from

  • masks – Unix style filter string or string list for filtering file name(s)

Example

>>> from torchdata.datapipes.iter import FSSpecFileLister
>>> datapipe = FSSpecFileLister(root=dir_path)

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources