MCPcopy 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
194def randomChoice(l):
195 return l[random.randint(0, len(l) - 1)]
196
197# Get a random category and random line from that category
198def randomTrainingPair():

Callers 1

randomTrainingPairFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected