MCPcopy Create free account
hub / github.com/OUCMachineLearning/OUCML / __init__

Method __init__

AutoML/darts-master/rnn/data.py:92–98  ·  view source on GitHub ↗
(self, sents, batch_size, pad_id=0, cuda=False, volatile=False)

Source from the content-addressed store, hash-verified

90
91class BatchSentLoader(object):
92 def __init__(self, sents, batch_size, pad_id=0, cuda=False, volatile=False):
93 self.sents = sents
94 self.batch_size = batch_size
95 self.sort_sents = sorted(sents, key=lambda x: x.size(0))
96 self.cuda = cuda
97 self.volatile = volatile
98 self.pad_id = pad_id
99
100 def __next__(self):
101 if self.idx >= len(self.sort_sents):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected