MCPcopy Create free account
hub / github.com/pytorch/examples / get_next_batch

Function get_next_batch

distributed/rpc/rnn/main.py:41–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39 criterion = torch.nn.CrossEntropyLoss()
40
41 def get_next_batch():
42 for _ in range(5):
43 data = torch.LongTensor(batch, nindices) % ntoken
44 target = torch.LongTensor(batch, ntoken) % nindices
45 yield data, target
46
47 # train for 10 iterations
48 for epoch in range(10):

Callers 1

_run_trainerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected