def sample_block()

in source/sagemaker/sagemaker_graph_fraud_detection/dgl_fraud_detection/sampler.py [0:0]


    def sample_block(self, seeds):
        blocks = []
        seeds = {self.category: seeds}
        cur = seeds
        for fanout in self.fanouts:
            if fanout is None:
                frontier = dgl.in_subgraph(self.g, cur)
            else:
                frontier = dgl.sampling.sample_neighbors(self.g, cur, fanout)
            block = dgl.to_block(frontier, cur)
            cur = {}
            for ntype in block.srctypes:
                cur[ntype] = block.srcnodes[ntype].data[dgl.NID]
            blocks.insert(0, block)
        return blocks, cur[self.category]