Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/hunkim/PyTorchZeroToAll
/ countries2tensor
Function
countries2tensor
13_2_rnn_classification.py:83–86 ·
view source on GitHub ↗
(countries)
Source
from the content-addressed store, hash-verified
81
82
83
def
countries2tensor(countries):
84
country_ids = [train_dataset.get_country_id(
85
country)
for
country in countries]
86
return
torch.LongTensor(country_ids)
87
88
89
class
RNNClassifier(nn.Module):
Callers
1
pad_sequences
Function · 0.85
Calls
1
get_country_id
Method · 0.80
Tested by
no test coverage detected