Skip to content

Commit 24c25c0

Browse files
NivekTfacebook-github-bot
authored andcommitted
Remove all Loaders from this library (#162)
Summary: Pull Request resolved: #162 Test Plan: Imported from OSS Reviewed By: ejguan Differential Revision: D33531857 Pulled By: NivekT fbshipit-source-id: 0c7606cb5a7b53e72d2b80450d9cbec1b236f74a
1 parent ec32ee4 commit 24c25c0

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

test/test_datapipe.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ def extract_datapipe_names(module):
4242
torchdata_datapipes = extract_datapipe_names(torchdata.datapipes.iter)
4343

4444
missing_datapipes = pytorch_datapipes - torchdata_datapipes
45+
deprecated_datapipes = {"FileLoader"}
46+
for dp in deprecated_datapipes:
47+
if dp in missing_datapipes:
48+
missing_datapipes.remove("FileLoader")
49+
4550
if any(missing_datapipes):
4651
msg = (
4752
"The following datapipes are exposed under `torch.utils.data.datapipes.iter`, "

torchdata/datapipes/iter/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
Concater,
77
Demultiplexer,
88
FileLister,
9-
FileLoader,
109
FileOpener,
1110
Filter,
1211
Forker,
@@ -32,7 +31,6 @@
3231
)
3332
from torchdata.datapipes.iter.load.iopath import (
3433
IoPathFileListerIterDataPipe as IoPathFileLister,
35-
IoPathFileLoaderIterDataPipe as IoPathFileLoader,
3634
IoPathFileOpenerIterDataPipe as IoPathFileOpener,
3735
IoPathSaverIterDataPipe as IoPathSaver,
3836
)
@@ -95,7 +93,6 @@
9593
"FSSpecFileOpener",
9694
"FSSpecSaver",
9795
"FileLister",
98-
"FileLoader",
9996
"FileOpener",
10097
"Filter",
10198
"Forker",
@@ -107,7 +104,6 @@
107104
"InMemoryCacheHolder",
108105
"IndexAdder",
109106
"IoPathFileLister",
110-
"IoPathFileLoader",
111107
"IoPathFileOpener",
112108
"IoPathSaver",
113109
"IterDataPipe",

torchdata/datapipes/iter/load/iopath.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Copyright (c) Facebook, Inc. and its affiliates.
22
import os
3-
import warnings
43

54
from typing import Any, Callable, Iterator, List, Optional, Tuple, Union
65

@@ -81,17 +80,6 @@ def __iter__(self) -> Iterator[str]:
8180
yield os.path.join(self.root, file_name)
8281

8382

84-
@functional_datapipe("load_file_by_iopath")
85-
class IoPathFileLoaderIterDataPipe(IterDataPipe[Tuple[str, StreamWrapper]]):
86-
def __new__(cls, source_datapipe: IterDataPipe[str], mode: str = "r", pathmgr=None):
87-
warnings.warn(
88-
"IoPathFileLoaderIterDataPipe and its functional API has been renamed and will be removed "
89-
"from this package. Please use 'IoPathFileOpenerIterDataPipe' instead.",
90-
DeprecationWarning,
91-
)
92-
return IoPathFileOpenerIterDataPipe(source_datapipe=source_datapipe, mode=mode, pathmgr=pathmgr)
93-
94-
9583
@functional_datapipe("open_file_by_iopath")
9684
class IoPathFileOpenerIterDataPipe(IterDataPipe[Tuple[str, StreamWrapper]]):
9785
r""":class:`IoPathFileOpenerIterDataPipe`.

0 commit comments

Comments
 (0)