Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/pytorch/examples
/ __init__
Method
__init__
word_language_model/data.py:6–8 ·
view source on GitHub ↗
(self)
Source
from the content-addressed store, hash-verified
4
5
class
Dictionary(object):
6
def
__init__(self):
7
self.word2idx = {}
8
self.idx2word = []
9
10
def
add_word(self, word):
11
if
word not in self.word2idx:
Callers
nothing calls this directly
Calls
no outgoing calls
Tested by
no test coverage detected