Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
130
def
argmax(vec):
131
# return the argmax as a python int
132
_, idx = torch.max(vec, 1)
133
return
idx.item()
134
135
136
def
prepare_sequence(seq, to_ix):
Callers
2
log_sum_exp
Function · 0.85
_viterbi_decode
Method · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected