MCPcopy Create free account
hub / github.com/pytorch/tutorials / argmax

Function argmax

beginner_source/nlp/advanced_tutorial.py:130–133  ·  view source on GitHub ↗
(vec)

Source from the content-addressed store, hash-verified

128
129
130def argmax(vec):
131 # return the argmax as a python int
132 _, idx = torch.max(vec, 1)
133 return idx.item()
134
135
136def prepare_sequence(seq, to_ix):

Callers 2

log_sum_expFunction · 0.85
_viterbi_decodeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected