Sample count of neighbors for each upstream node. Args: count (int): For "full" strategy, the neighbors will be truncated by the given count if `count` > 0, otherwise, the real count of neighbors would return. For other sampling strategies, the returned neighbors w
(self, count)
| 180 | return self |
| 181 | |
| 182 | def sample(self, count): |
| 183 | """Sample count of neighbors for each upstream node. |
| 184 | |
| 185 | Args: |
| 186 | count (int): For "full" strategy, the neighbors will be truncated by |
| 187 | the given count if `count` > 0, otherwise, the real count of neighbors |
| 188 | would return. For other sampling strategies, the returned neighbors |
| 189 | would be padded with the given PaddingMode. |
| 190 | """ |
| 191 | assert isinstance(count, int) |
| 192 | self._add_param(pywrap.kNeighborCount, count) |
| 193 | self._add_param(pywrap.kPartitionKey, pywrap.kSrcIds) |
| 194 | self._shape = (np.prod(self._shape), count) |
| 195 | return self |
| 196 | |
| 197 | def by(self, strategy): |
| 198 | self._strategy = strategy |