def inference(self, dataloader, x_all, device):
        """Conduct layer-wise inference to get all the node embeddings."""
        for i, layer in tqdm(enumerate(self.layers), "inference"):
            xs = []
            for minibatch in dataloader:
                # Call `to_pyg_data` to convert GB Minibatch to PyG Data.
                pyg_data = minibatch.to_pyg_data()
                n_id = pyg_data.n_id.to("cpu")
                x = x_all[n_id].to(device)
                edge_index = pyg_data.edge_index
                x = layer(x, edge_index)
                x = x[: pyg_data.batch_size]
                if i != len(self.layers) - 1:
                    x = x.relu()
                xs.append(x.cpu())
            x_all = torch.cat(xs, dim=0)
        return x_all
Conduct layer-wise inference to get all the node embeddings.
examples/graphbolt/pyg/node_classification.py