MCPcopy
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
83def countries2tensor(countries):
84 country_ids = [train_dataset.get_country_id(
85 country) for country in countries]
86 return torch.LongTensor(country_ids)
87
88
89class RNNClassifier(nn.Module):

Callers 1

pad_sequencesFunction · 0.85

Calls 1

get_country_idMethod · 0.80

Tested by

no test coverage detected