"docs/source/models.decoder.rst" did not exist on "10cce19841db4953fadee4e46416dd8a32b92582"
Commit b1c4a2d6 authored by Jared Casper's avatar Jared Casper
Browse files

Document indexed_dataset.get() a bit.

parent da0562fc
......@@ -487,6 +487,11 @@ class MMapIndexedDataset(torch.utils.data.Dataset):
return sents
def get(self, idx, offset=0, length=None):
""" Retrieves a single item from the dataset with the option to only
return a portion of the item.
get(idx) is the same as [idx] but get() does not support slicing.
"""
ptr, size = self._index[idx]
if length is None:
length = size - offset
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment