@@ -102,8 +102,8 @@ def __init__(self, mu, tau, ndim=None, size=None, dtype=None, *args,
102
102
103
103
self .median = self .mode = self .mean = self .mu
104
104
# TODO: How do we want to use ndim?
105
- shape_supp = self .mu .shape [- 1 ]
106
- shape_ind = self .mu .shape [:- 1 ]
105
+ shape_supp = ( self .mu .shape [- 1 ],)
106
+ shape_ind = tuple ( self .mu .shape [:- 1 ])
107
107
108
108
if self .mu .ndim > 0 :
109
109
bcast = (False ,) * (1 + tt .get_vector_length (shape_ind ))
@@ -261,8 +261,8 @@ def __init__(self, a, transform=transforms.stick_breaking, ndim=None, size=None,
261
261
self .dist_params = (self .a ,)
262
262
263
263
# TODO: How do we want to use ndim?
264
- shape_supp = self .a .shape [- 1 ]
265
- shape_ind = self .a .shape [:- 1 ]
264
+ shape_supp = ( self .a .shape [- 1 ],)
265
+ shape_ind = tuple ( self .a .shape [:- 1 ])
266
266
267
267
# FIXME: this isn't correct/ideal
268
268
if self .a .ndim > 0 :
@@ -358,7 +358,7 @@ def __init__(self, n, p, ndim=None, size=None, dtype=None, *args,
358
358
359
359
# TODO: check that n == len(p)?
360
360
# TODO: How do we want to use ndim?
361
- shape_supp = self .n
361
+ shape_supp = ( self .n ,)
362
362
shape_ind = ()
363
363
364
364
# FIXME: this isn't correct/ideal
@@ -500,12 +500,11 @@ def __init__(self, n, V, ndim=None, size=None, dtype=None, *args,
500
500
self .dist_params = (self .n , self .V )
501
501
502
502
# TODO: How do we want to use ndim?
503
- shape_supp = self .V .shape [- 1 ]
503
+ shape_supp = ( self .V .shape [- 1 ],)
504
504
shape_ind = ()
505
505
506
- self .mode = tt .switch (1 * (self .n >= shape_supp + 1 ), (self .n -
507
- shape_supp - 1 )
508
- * self .V , np .nan )
506
+ self .mode = tt .switch (1 * (self .n >= shape_supp + 1 ),
507
+ (self .n - shape_supp - 1 ) * self .V , np .nan )
509
508
self .mean = self .n * self .V
510
509
511
510
# FIXME: this isn't correct/ideal
@@ -662,19 +661,18 @@ def __init__(self, n, p, ndim=None, size=None, dtype=None, *args, **kwargs):
662
661
self .n = tt .as_tensor_variable (n , ndim = 0 )
663
662
self .p = tt .as_tensor_variable (p , ndim = 0 )
664
663
664
+ self .dist_params = (self .n , self .p )
665
+
665
666
# TODO: How do we want to use ndim?
666
667
n_elem = (self .p * (self .p - 1 ) / 2 )
667
- shape_supp = n_elem
668
+ shape_supp = ( n_elem ,)
668
669
self .mean = tt .zeros (n_elem )
669
670
670
671
# FIXME: triu, bcast, etc.
671
672
self .tri_index = tt .zeros ((self .p , self .p ), dtype = int )
672
673
self .tri_index [tt .triu (self .p , k = 1 )] = tt .arange (n_elem )
673
674
self .tri_index [tt .triu (self .p , k = 1 )[::- 1 ]] = tt .arange (n_elem )
674
675
675
- self .dist_params = (self .n , self .p )
676
-
677
- # TODO: do this correctly; what about replications?
678
676
shape_ind = ()
679
677
680
678
# FIXME: this isn't correct/ideal
0 commit comments