pyg-team/pytorch_geometric

Provide a helper for easier batching

Open

#70 aberto em 10 de jan. de 2019

Ver no GitHub
 (4 comments) (0 reactions) (0 assignees)Python (3.514 forks)batch import
2 - Priority P2featurehelp wantedloader

Métricas do repositório

Stars
 (19.985 stars)
Métricas de merge de PR
 (Mesclagem média 35d 1h) (14 fundiu PRs em 30d)

Description

DataLoader are handy in some situations however they do not cover all potential use cases. For now, I only found the following way of handling batches without them. Would it be possible to have a nice helper in native torch for this?

def forward(self, x, edge_index):
        batch_size, n_size = x.shape[:2]
        batch = [torch_geometric.data.Data(x=t, edge_index=edge_index) for t in x]
        batch = torch_geometric.data.Batch.from_data_list(batch)
        x = self.net(batch.x, batch.edge_index).view(batch_size, n_size, 1)
        return x

Guia do colaborador