Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Megatron-LM
Commits
b1c4a2d6
"docs/source/models.decoder.rst" did not exist on "10cce19841db4953fadee4e46416dd8a32b92582"
Commit
b1c4a2d6
authored
Apr 08, 2020
by
Jared Casper
Browse files
Document indexed_dataset.get() a bit.
parent
da0562fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
megatron/data/indexed_dataset.py
megatron/data/indexed_dataset.py
+5
-0
No files found.
megatron/data/indexed_dataset.py
View file @
b1c4a2d6
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment