| 405 | raise ValueError("Ids must be the same length of indices") |
| 406 | |
| 407 | def __next__(self): |
| 408 | if self._it < len(self._offsets): |
| 409 | l = self._global_offsets[self._it] |
| 410 | r = self._global_offsets[self._it + 1] |
| 411 | self._it += 1 |
| 412 | nodes = Nodes(self._ids[l: r], self._type, graph=self._graph, |
| 413 | int_attrs=np.array([int_attr[l: r] \ |
| 414 | for int_attr in self._int_attrs]) \ |
| 415 | if self._int_attrs is not None else None, |
| 416 | float_attrs=np.array([float_attr[l: r] \ |
| 417 | for float_attr in self._float_attrs]) \ |
| 418 | if self._float_attrs is not None else None, \ |
| 419 | string_attrs=np.array([string_attr[l: r] \ |
| 420 | for string_attr in self._string_attrs]) \ |
| 421 | if self._string_attrs is not None else None, |
| 422 | weights=self._weights[l:r] \ |
| 423 | if self._weights is not None else None, |
| 424 | labels=self._labels[l:r] \ |
| 425 | if self._labels is not None else None) |
| 426 | return nodes |
| 427 | else: |
| 428 | raise StopIteration |
| 429 | |
| 430 | def embedding_agg(self, func="sum"): |
| 431 | """ |