in hype/adjacency_matrix_dataset.pyx [0:0]
def _worker(self, tid):
cdef long [:,:] memview
cdef int count
cdef double [:] weights
cdef unsigned long seed
seed = tid
while self.current < self.neighbors.shape[0]:
start = self.current
self.current += self.batch_size
batch = torch.LongTensor(self.batch_size, self.nnegatives() + 2)
memview = batch.numpy()
with nogil:
count = self._getbatch(start, memview, &seed)
if count < self.batch_size:
batch = batch.narrow(0, 0, count)
self.queue.put((batch, torch.zeros(count).long()))
self.queue.put(tid)