Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/pytorch/tutorials
/ randomChoice
Function
randomChoice
intermediate_source/char_rnn_generation_tutorial.py:194–195 ·
view source on GitHub ↗
(l)
Source
from the content-addressed store, hash-verified
192
193
# Random item from a list
194
def
randomChoice(l):
195
return
l[random.randint(0, len(l) - 1)]
196
197
# Get a random category and random line from that category
198
def
randomTrainingPair():
Callers
1
randomTrainingPair
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected