AlliedToasters / synapses

MIT License
70 stars 12 forks source link

Fix scatter_add bug in SETLayer.forward #4

Open 7iW opened 4 years ago

7iW commented 4 years ago

A bug in scatter_add could cause a dimension mismatch in the return z + self.bias line of SETLayer.forward. The call scatter_add(k, self.inds_out) produces a tensor of length max(self.inds_out)+1, which might not be equal to self.outdim. This commit fixes this issue by using the dim_size keyword of the scatter_add function.