Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit af3d1e8

Browse files
committed
Updating usage of torch.utils.data.graph.traverse in test case
ghstack-source-id: ad675a0 Pull Request resolved: #1927
1 parent 3f9c349 commit af3d1e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/torchtext_unittest/datasets/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pickle
22

33
from parameterized import parameterized
4-
from torch.utils.data.graph import traverse
4+
from torch.utils.data.graph import traverse_dps
55
from torch.utils.data.graph_settings import get_all_graph_pipes
66
from torchdata.dataloader2.linter import _check_shuffle_before_sharding
77
from torchdata.datapipes.iter import Shuffler, ShardingFilter
@@ -37,7 +37,7 @@ def test_shuffle_shard_wrapper(self, dataset_fn):
3737
for dp_split in dp:
3838
_check_shuffle_before_sharding(dp_split)
3939

40-
dp_graph = get_all_graph_pipes(traverse(dp_split))
40+
dp_graph = get_all_graph_pipes(traverse_dps(dp_split))
4141
for annotation_dp_type in [Shuffler, ShardingFilter]:
4242
if not any(isinstance(dp, annotation_dp_type) for dp in dp_graph):
4343
raise AssertionError(f"The dataset doesn't contain a {annotation_dp_type.__name__}() datapipe.")

0 commit comments

Comments
 (0)