The m array should be filled with explicit boolean values to be used directly as it is. If m is filled with zeros and ones (as integer values), it seems that msk[m] treats m as a list of indexes in some cases. For example, when calling get_allowed_shapes(3), the topology [1, 1, 0] --- which is indeed an allowed shape --- is wrongly discarded due to m being interpreted as an list of indexes.
The
m
array should be filled with explicit boolean values to be used directly as it is. Ifm
is filled with zeros and ones (as integer values), it seems thatmsk[m]
treatsm
as a list of indexes in some cases. For example, when callingget_allowed_shapes(3)
, the topology[1, 1, 0]
--- which is indeed an allowed shape --- is wrongly discarded due tom
being interpreted as an list of indexes.