I am trying to randomly generate integer partitions (N into M parts) in pytorch with a minimum partition size of 1.
For example, (3, 1, 1)
and (4, 1, 0)
are both partitions of 5 into 3 parts but (4, 1, 0)
's minimum partition size is 0 so this should not be allowed
I would like to use this to generate my dataset on demand, so would nice if there was a pytorch (parrallel/gpgpu) solution.
See other questions about generating integer partitions: