• Ricardo Vieira's avatar
    Fix Choice and Permutation not respecting the RandomVariable contract · d80c0bf7
    Ricardo Vieira 提交于
    These two RVs don't fall into the traditional RandomVariable contract because they don't have a concept of `batch_ndim`s. The hard-coded ndim params and ndim support were wrong and need to be defined for every node.
    
    * ChoiceRV was removed in favor of ChoiceWithoutReplacementRV which handles the cases without replacement. Those with replacement can be trivially be implemented with other basic RVs.
    * Both Permutation and ChoiceWithoutReplacement now support batch ndims
    * Avoid materializing the implicit arange
    d80c0bf7
test_basic.py 46.4 KB