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
Fairseq
Commits
28069cf4
"docs/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "0c775544dd14364ad85611648ab4dcb5a2e6a231"
Commit
28069cf4
authored
Sep 21, 2018
by
alexeib
Committed by
Myle Ott
Sep 25, 2018
Browse files
fix issue with truncated dict
parent
cfd2a3a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
fairseq/data/dictionary.py
fairseq/data/dictionary.py
+3
-3
No files found.
fairseq/data/dictionary.py
View file @
28069cf4
...
...
@@ -203,9 +203,9 @@ class Dictionary(object):
class
TruncatedDictionary
(
object
):
def
__init__
(
self
,
wrapped_dict
,
length
):
self
.
__class__
=
type
(
dict
.
__class__
.
__name__
,
(
self
.
__class__
,
dict
.
__class__
),
{})
self
.
__dict__
=
dict
.
__dict__
self
.
__class__
=
type
(
wrapped_
dict
.
__class__
.
__name__
,
(
self
.
__class__
,
wrapped_
dict
.
__class__
),
{})
self
.
__dict__
=
wrapped_
dict
.
__dict__
self
.
wrapped_dict
=
wrapped_dict
self
.
length
=
min
(
len
(
self
.
wrapped_dict
),
length
)
...
...
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