SAGPool icon indicating copy to clipboard operation
SAGPool copied to clipboard

Batch operation

Open lonelygoatherd opened this issue 4 years ago • 1 comments

Hi, thank for sharing the codes. In the networks.py, what does the variable "data.batch" denote in the forward method? I have looked up to pyg document, and found neither Data nor DataLoader has "batch" attribute. So what is the difference of it with the input x? 你好,请问networks里的forward函数,x和batch有什么不同呢,data有batch属性吗?找了半天没找到,但是运行都可以

lonelygoatherd avatar Aug 05 '20 11:08 lonelygoatherd

I think the 'batch' variable is for the global_max_pool and global_mean_pool functions (readout). x1 = torch.cat([gmp(x, batch), gap(x, batch)], dim=1)

see pytorch geometric doc

batch (LongTensor) – Batch vector, which assigns each node to a specific example.

icecat2012 avatar Jul 31 '21 14:07 icecat2012