Felix-Petersen / difflogic

A Library for Differentiable Logic Gate Networks
MIT License
345 stars 34 forks source link

fix tensor_packbits_cuda_kernel for when batch size is not a multiple of bit count #17

Closed mahdizaferanchi closed 7 months ago

mahdizaferanchi commented 7 months ago

Fixed this issue.

The new kernel also makes sure that padding bits are all zeros. Although I think this isn't necessary for correct operation.

Also added __repr__ to PackBitsTensor which helps detect the problem or the lack of it and is also generally useful.

Felix-Petersen commented 7 months ago

Thanks @mahdizaferanchi for fixing this bug! 🪲