Here is the test https://github.com/pytorch/text/blob/2aa8858272d9b46b71194616ab948a087081207f/test/data/test_dataset.py#L169-L202